I am using the CImg library for the first time and I get compilation errors with a simple test program that just includes CImg.h. Why is that? How can I fix this?
Progra
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. those functions are not declared unless __MSVCRT_VERSION__
is at least 0x800. The following might work (at least it did for 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 does not contain declaration for _fseeki64
and others, either
_fseeki64
,_fseeki64
(if such one can be found somewhere).