简体   繁体   中英

codeblock compiler c++ error using mingw64

I have a project using CB. The compiler is MingW64 When I use GNU GCC x64 to ccompile it. No error. When I switch to GNU GCC (32 bit) I get those error

C:..\SDK\ScopeCppSDK\vc15\SDK\include\shared\basetsd.h error: cast from 'const void*' to 'long unsigned int' loses precision [-fpermissive]

x86_64-w64-mingw32\include\debugapi.h error: 'WINBOOL' does not name a type;

x86_64-w64-mingw32\include\fileapi.h error: 'WINBOOL' does not name a type;

Then I move the folder of vc15\SDK to vc15\SDK_old so MingW cannot find it. Then compile the project with GNU GCC(32). No error.

So the problem seems coming from basetsd.h

But this MS SDK is not in the searching path

How it is involvded? Why CB with MnGW uses MS SDK?

This is implementation dependent. But usually, a 32bit compiler on a 64bit architecture has 64bit pointers and long int is 32bits. So, you are trying to cast a 64bit value into 32 bits

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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