我正在尝试使用 std=c++0x 和 MingW 编译以下 CImg 示例代码:
#include "CImg.h"
using namespace cimg_library;
int main() {
CImg<unsigned char> img(640,400,1,3);
img.fill(0);
unsigned char purple[] = { 255,0,255 };
img.draw_text(100,100,"Hello World",purple);
img.display("My first CImg code");
return 0;
}
当我编译使用:
g++ -std=c++0x HelloWorld.cpp -lgdi32
我收到以下错误:
error: '_fileno' was not declared in this scope
但是当我在没有 std=c++0x 的情况下编译时,它可以完美运行:
g++ HelloWorld.cpp -lgdi32
如何在启用 c++0x 的情况下编译 CImg?