更新后的 wxDevCpp 中的 BGI 不起作用
BGI in updated wxDevCpp does not work
我需要在我的程序中使用BGI图形,它在wxDevCpp 7.3中运行良好。但是现在我安装了这个 IDE 7.4 的更新版本,像以前一样 http://www.cs.colorado.edu/~main/bgi/dev-c++/指令执行所有操作,但现在当我尝试编译任何简单的程序时,例如
#include <graphics.h>
int main( )
{
initwindow(400, 300, "First Sample");
circle(100, 50, 40);
while (!kbhit( ))
{
delay(200);
}
return 0;
}
我收到多个错误,说
initwindow(), circle(), kbhit(), delay()
未在范围内声明。我不知道该怎么办。更新后的wxDevCpp的变化是不同的文件夹结构,但我将graphics.h和libbgi.a复制粘贴到几个文件夹中。我没有忘记按照说明添加链接器命令,但它不起作用。另外,我发现了另一个图形.h,它伴随着新的wxDevCpp的安装,虽然它可能会带来冲突,所以我只是删除了它。:(无变化
我想我解决了!这实际上是图形的问题。当我将所有 graphics.h 复制粘贴到我的.cpp中时,编译器给出了一个错误,即在以下代码中声明了两次 int right:
void printimage(
const char* title=NULL,
double width_inches=7, double border_left_inches=0.75, double border_top_inches=0.75,
int left=0, int right=0, int right=INT_MAX, int bottom=INT_MAX,
bool active=true, HWND hwnd=NULL
);
重新定义int right,因此它只是一个原型,我将其更改为:
void printimage(
const char* title=NULL,
double width_inches=7, double border_left_inches=0.75, double border_top_inches=0.75,
int left=0, int right=0, int=INT_MAX, int bottom=INT_MAX,
bool active=true, HWND hwnd=NULL
);
现在它起作用了!!
相关文章:
- 我的神经网络不起作用 [XOR 问题]
- 在C++程序中输入的文本文件将不起作用,除非文本被复制和粘贴
- C++映射:具有自定义类的运算符[]不起作用(总是返回0)
- C++为什么尽管我调用了void函数,它却不起作用
- 为什么在保护模式下继承升级不起作用
- 循环在计数器中不起作用
- 在其他文件中创建类时在 c++ 项目中不起作用
- Visual studio代码重构似乎不起作用(例如,重命名符号-f2)
- 为什么二进制搜索在我的测试中不起作用
- 我的代码中有错误吗?使用BGI图形的C++代码对我不起作用
- 为什么 const std::p air<K,V>& 在 std::map 上基于范围的 for 循环不起作用?
- 带有指定长度字符* 参数的 std::regex_search 在 VS2017 中不起作用?
- Bjarne Stroustrup Book - std_lib_facilities.h - 不起作用(未知类型名称)
- 为什么简单的算术减法在"if"条件下不起作用?
- 为什么Stroustup书中的has_f不起作用
- 你能检查一下为什么在这个代码中从链接列表中删除项目不起作用吗
- 嵌套While循环不起作用(C++问题)
- C++Matching Brackets 2解决方案不起作用
- 为什么循环不起作用?(BGI形状)
- 更新后的 wxDevCpp 中的 BGI 不起作用