简体   繁体   English

库中的MinGW-w64编译错误

[英]MinGW-w64 compilation errors in libraries

I'm getting the following errors after changing from MinGW to MinGW-w64: 从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);
                  ^

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... 我昨天在用Code :: Blocks设置MinGW-w64时遇到了这个问题,并通过以下方式解决了这个问题...

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. 编译器的搜索目录指向MinGW的include文件夹(我假设是默认的32位编译器目录)和新安装的MinGW-w64编译器的include文件夹。

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 现在,如果您的情况与我的相似,请执行以下操作:(1)将MinGW中的include文件夹添加到了全局编译器“ Compiler”选项卡下的MinGW(GNU GCC编译器)的搜索目录中设置(2)在设置MinGW-w64编译器时复制了GNU GCC编译器的设置

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. 因此,在这种情况下,您需要做的只是从新编译器的搜索目录中删除旧编译器的include文件夹的路径。

Please let me know if it works out. 请让我知道是否可行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM