我是第一次使用 CImg 库,在使用仅包含 CImg.h 的简单测试程序时出现编译错误。这是为什么?我怎样才能解决这个问题?
程序代码:
#include "../headers/CImg.h"
using namespace cimg_library;
int main()
{
return 0;
}
编译错误:
In function 'FILE* cimg_library::cimg::fopen(const char*, const char*)':
5065|error: '_fileno' was not declared in this scope
In function 'int cimg_library::cimg::fseek(FILE*, INT_PTR, int)':
5093|error: '_fseeki64' was not declared in this scope
In function 'INT_PTR cimg_library::cimg::ftell(FILE*)':
5102|error: '_ftelli64' was not declared in this scope
这是在装有 64 位 Windows 8.1 的 PC 上完成的。
Command:
g++.exe -Wall -fexceptions -g -std=c++11 -c "D:\informatics\Projects\image experiments\Rectangle to circle stretcher\sources\main.cpp" -o obj\Debug\sources\main.o
我试过这个没有-std=c++11
部分,我得到 2 个错误而不是 3 个。我不明白5065|error: '_fileno' was not declared in this scope
。如果我将其替换为,也会发生同样的情况-std=gnu++11
我也在我的笔记本电脑上尝试过,它运行的是 64 位版本的 Windows 7,同样的情况也发生了。
到目前为止,我已经解决了第一个错误,但没有解决其他两个错误。