获得程序输出(无错误),但程序.exe在使用 graphics.h 时不起作用
Program output obtained(no error) but program.exe not working while using graphics.h
我已经有 graphics.h(以及 MinGW 中的相关文件),但程序无法正常工作,因为在构建并运行后,我在输出窗口中获得所需的文本输出,但没有相应的图形因为program_name.exe停止工作。我已经在网上搜索了所有内容,StackOverflow是我最后的希望。我一直在用 c+ + 进行竞争性编程,只是试图在代码块中使用 c++ 进入图形。
#include <graphics.h>
#include <iostream>
using namespace std;
int main()
{ cout<<"a";
int gd= DETECT,gm ;
char driver[] = "";
initgraph(&gd, &gm, driver);
//initgraph(&gd,&gm," ");
circle (100,100,100) ;
getch();
closegraph();
return 0;
}
这是
非常复古的。 为了使它接近工作,你需要在VirtualBox下创建一个MSDOS虚拟机,安装DOS 6.2或类似版本,安装Borland BGI,Borland C++ 5.02,然后你可能会让它工作。 如果做不到这一点,你可以找到一台旧的IBM PC并在上面安装DOS以及上面的其他所有东西。玩得愉快!
相关文章:
- Mongodb c++驱动程序:如何查询元素的数组
- C++,系统无法执行指定的程序
- 在C++程序中输入的文本文件将不起作用,除非文本被复制和粘贴
- 在VS代码中交叉编译Windows与Linux上的MinGW的SDL程序
- C++ Windows 驱动程序MSB3030无法复制该文件,因为它找不到
- 重载操作程序时出错>>用于类中的字符串 memebr
- 获取日期异步信号安全吗?如果在信号处理程序中使用,它会导致死锁吗
- 试图在visual studio上用C++创建一个桌面应用程序
- 模板元程序查找相似的连续类型名称
- FFmpeg:制作一个应用程序比直接使用ffmepg更好吗
- 如何通过cpp程序运行shell脚本
- 有没有什么方法可以使用一个函数中定义的常量变量,也可以由c++中同一程序中的其他函数使用
- IPC使用多个管道和分支进程来运行Python程序
- 如何将c++程序的一些输出传递给shell,以便在shell中使用
- 使用C++程序合并排序没有得到正确的输出
- 基于boost的程序的静态链接——zlib问题
- 程序崩溃并显示"std::out_of_range"错误
- 获得程序输出(无错误),但程序.exe在使用 graphics.h 时不起作用
- 基于graphics.h的程序出现代码块运行时错误
- 如何在C++程序中获取和使用头文件 <graphics.h>?