c++ - Compilation errors with CImg -
i using cimg library first time , compilation errors simple test program includes cimg.h. why that? how can fix this?
program code:
#include "../headers/cimg.h" using namespace cimg_library; int main() { return 0; }
compilation errors:
in function 'file* cimg_library::cimg::fopen(const char*, const char*)': 5065|error: '_fileno' not declared in scope in function 'int cimg_library::cimg::fseek(file*, int_ptr, int)': 5093|error: '_fseeki64' not declared in scope in function 'int_ptr cimg_library::cimg::ftell(file*)': 5102|error: '_ftelli64' not declared in scope
this done on pc 64 bit windows 8.1.
command:
g++.exe -wall -fexceptions -g -std=c++11 -c "d:\informatics\projects\image experiments\rectangle circle stretcher\sources\main.cpp" -o obj\debug\sources\main.o
i tried without -std=c++11
part , 2 errors instead of 3. don't 5065|error: '_fileno' not declared in scope
. same happens if replace -std=gnu++11
i tried on laptop, runs 64 bit version of windows 7, , same happens there.
so far, have work around first error, nothing other two.
in case of codeblock 16.01 stdio.h contains lines
#if __msvcrt_version__ >= 0x800 _crtimp int __cdecl __mingw_nothrow _fseek_nolock (file*, long, int); _crtimp long __cdecl __mingw_nothrow _ftell_nolock (file*); _crtimp int __cdecl __mingw_nothrow _fseeki64 (file*, __int64, int); _crtimp __int64 __cdecl __mingw_nothrow _ftelli64 (file*); _crtimp int __cdecl __mingw_nothrow _fseeki64_nolock (file*, __int64, int); _crtimp __int64 __cdecl __mingw_nothrow _ftelli64_nolock (file*); #endif
i.e. functions not declared unless __msvcrt_version__
@ least 0x800. following might work (at least did codeblocks 16.01)
#if defined(__mingw32__) #define __msvcrt_version__ 0x800 #define _win32_winnt 0x0500 #endif // if needed // #define _fileno fileno #include "cimg.h"
if stdio.h not contain declaration _fseeki64
, others, either
- use cimg 1.6.9 not use
_fseeki64
, - upgrade gcc/g++, or
- provide own implementation
_fseeki64
(if such 1 can found somewhere).
Comments
Post a Comment