[英]codeblock compiler c++ error using mingw64
I have a project using CB.我有一个使用 CB 的项目。 The compiler is MingW64 When I use GNU GCC x64 to ccompile it.当我使用 GNU GCC x64 对其进行 ccompile 时,编译器是 MingW64。 No error.没有错误。 When I switch to GNU GCC (32 bit) I get those error当我切换到 GNU GCC(32 位)时,我得到了这些错误
C:..\SDK\ScopeCppSDK\vc15\SDK\include\shared\basetsd.h error: cast from 'const void*' to 'long unsigned int' loses precision [-fpermissive] C:..\SDK\ScopeCppSDK\vc15\SDK\include\shared\basetsd.h 错误:从 'const void*' 转换为 'long unsigned int' 失去精度 [-fpermissive]
x86_64-w64-mingw32\include\debugapi.h error: 'WINBOOL' does not name a type; x86_64-w64-mingw32\include\debugapi.h 错误:'WINBOOL' 没有命名类型;
x86_64-w64-mingw32\include\fileapi.h error: 'WINBOOL' does not name a type; x86_64-w64-mingw32\include\fileapi.h 错误:'WINBOOL' 没有命名类型;
Then I move the folder of vc15\SDK to vc15\SDK_old so MingW cannot find it.然后我将 vc15\SDK 的文件夹移动到 vc15\SDK_old 所以 MingW 找不到它。 Then compile the project with GNU GCC(32).然后用 GNU GCC(32) 编译项目。 No error.没有错误。
So the problem seems coming from basetsd.h所以问题似乎来自 basetsd.h
But this MS SDK is not in the searching path但是这个 MS SDK 不在搜索路径中
How it is involvded?它是如何涉及的? Why CB with MnGW uses MS SDK?为什么带有 MnGW 的 CB 使用 MS SDK?
This is implementation dependent.这取决于实现。 But usually, a 32bit compiler on a 64bit architecture has 64bit pointers and long int
is 32bits.但通常,64 位架构上的 32 位编译器具有 64 位指针,而long int
是 32 位。 So, you are trying to cast a 64bit value into 32 bits因此,您正在尝试将 64 位值转换为 32 位
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.