在图书馆的MinGW-W64编译错误(MinGW-w64 compilation errors in

2019-10-21 09:51发布

改变从MinGW的到的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);
                  ^

任何人都可以向我解释这里发生了什么?

Answer 1:

我设置的MinGW-W64与代码::块时,昨天刚有这个问题,得到了解决它以下列方式...

请注意以下内容打造讯息:

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

编译器的搜索目录指向MinGW的的包括文件夹(我假设默认的32位编译器目录),并新安装的MinGW-W64编译器包括文件夹。

现在,如果你的情况是像我这样的事情,你已经做了以下内容:(1)增加了包括MinGW的文件夹为MinGW的(GNU GCC编译)“编译器”选项卡下的全局编译程序的搜索目录设定(2)复制GNU GCC编译器的设置时的MinGW-W64编译器的设置

所以,你需要在这种情况下,做的是简单地由新的编译器的搜索目录中删除旧的编译器包括文件夹的路径。

请让我知道,如果它的作品了。



文章来源: MinGW-w64 compilation errors in libraries