问题
I'm getting the following errors after changing from MinGW to MinGW-w64:
In file included from C:/MinGW/i686-w64-mingw32/include/stddef.h:7:0,
from C:/MinGW/lib/gcc/i686-w64-mingw32/4.9.2/include/stddef.h:1,
from C:\MinGW\include/stdint.h:24,
from C:\MinGW\include/inttypes.h:7,
from C:\MinGW\include/GL/glew.h:299,
from ..\main.cpp:1:
C:/MinGW/i686-w64-mingw32/include/crtdefs.h:26:9: error: 'size_t' does not name a type
typedef size_t rsize_t;
^
In file included from C:/MinGW/lib/gcc/i686-w64-mingw32/4.9.2/include/stddef.h:1:0,
from C:\MinGW\include/stdint.h:24,
from C:\MinGW\include/inttypes.h:7,
from C:\MinGW\include/GL/glew.h:299,
from ..\main.cpp:1:
C:/MinGW/i686-w64-mingw32/include/stddef.h:20:3: error: 'errno_t' does not name a type
errno_t __cdecl _set_errno(int _Value);
^
C:/MinGW/i686-w64-mingw32/include/stddef.h:21:3: error: 'errno_t' does not name a type
errno_t __cdecl _get_errno(int *_Value);
^
C:/MinGW/i686-w64-mingw32/include/stddef.h:26:18: error: 'uintptr_t' does not name a type
_CRTIMP extern uintptr_t __cdecl __threadhandle(void);
^
Can anyone explain to me what is happening here?
回答1:
I just had this problem yesterday when setting up MinGW-w64 with Code::Blocks and got to solve it in the following way...
Notice the following build messages:
from C:/MinGW/i686-w64-mingw32/include/stddef.h:7:0,
from C:/MinGW/lib/gcc/i686-w64-mingw32/4.9.2/include/stddef.h:1,
from C:\MinGW\include/stdint.h:24,
from C:\MinGW\include/inttypes.h:7
The compiler's search directories point to the include folder of MinGW (I'm assuming the default 32-bit compiler directory) and to the include folder of the newly installed MinGW-w64 compiler.
Now if you're case is anything like mine, you've done the following: (1) Added the include folder in the MinGW to the search directories for the MinGW (GNU GCC Compiler) under the "Compiler" tab in the global compiler settings (2) Copied the settings of GNU GCC Compiler when setting up the MinGW-w64 compiler
So, what you need to do in that case is to simply remove the path of the include folder of the old compiler from the search directories of the new compiler.
Please let me know if it works out.
来源:https://stackoverflow.com/questions/27429055/mingw-w64-compilation-errors-in-libraries