库中的MinGW-w64编译错误 [英] MinGW-w64 compilation errors in libraries
问题描述
从MinGW更改为MinGW-w64后,我收到以下错误:
来自C:/MinGW/lib/gcc/i686-w64-mingw32/4.9.2/include/stddef.h:1的MinGW / i686-w64-mingw32 / include / stddef.h:7:0,
,
从C:\MinGW\include / stdint.h:24,
从C:\MinGW\include / inttypes.h:7,
从C:\MinGW \include / GL / glew.h:299,
从.. \main.cpp:1:
C:/MinGW/i686-w64-mingw32/include/crtdefs.h:26: 9:错误:'size_t'不命名类型
typedef size_t rsize_t;
^
在C:/MinGW/lib/gcc/i686-w64-mingw32/4.9.2/include/stddef.h:1:0,
从C: \\ MinGW \include / stdint.h:24,
从C:\MinGW\include / inttypes.h:7,
从C:\MinGW\include / GL / glew。 h:299,
从.. \main.cpp:1:
C:/MinGW/i686-w64-mingw32/include/stddef.h:20:3:错误:'errno_t'不是类型
errno_t __cdecl _set_errno(int _Value);
^
C:/MinGW/i686-w64-mingw32/include/stddef.h:21:3:错误:'errno_t'不命名类型
errno_t __cdecl _get_errno(int * _值);
^
C:/MinGW/i686-w64-mingw32/include/stddef.h:26:18:error:'uintptr_t'没有命名类型
_CRTIMP extern uintptr_t __cdecl __threadhandle void);
^
任何人都可以向我解释这里发生了什么?
我昨天使用Code :: Blocks设置MinGW-w64时遇到了这个问题,并以下列方式解决: p>
请注意以下构建消息:
从C:/ MinGW / i686 -w64-mingw32 / include / stddef.h:7:0,
来自C:/MinGW/lib/gcc/i686-w64-mingw32/4.9.2/include/stddef.h:1,
从C:\MinGW\include / stdint.h:24,
从C:\MinGW\include / inttypes.h:7
编译器的搜索目录指向MinGW的include文件夹(假设为默认的32位编译器目录),并指向新安装的MinGW- w64编译器。
现在如果你的case是我的任何东西,你做了以下:
(1)添加了MinGW中的include文件夹到搜索在全局编译器设置中的Compiler选项卡下的MinGW(GNU GCC Compiler)目录
(2)设置MinGW-w64编译器时复制GNU GCC Compiler的设置
因此,在这种情况下,您只需从新编译器的搜索目录中删除旧编译器的include文件夹的路径即可。
请让我知道如果它工作。
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?
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.
这篇关于库中的MinGW-w64编译错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!