简体   繁体   English

使用 mingw64 的代码块编译器 c++ 错误

[英]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.

相关问题 Bazel、Windows 10 工具链配置与 mingw64 编译器 - Bazel, Windows 10 toolchain configuration with mingw64 compiler 无法在 C 程序中正确使用 C++ 静态库(Mingw64 with CLion) - Cannot properly use C++ static library in C program (Mingw64 with CLion) C ++-to_string在Windows中的Code :: Blocks中无法在多个编译器(MinGW,MinGW64,TDM GCC)之间运行 - C++ - to_string not working across multiple compilers (MinGW, MinGW64, TDM GCC) in Code::Blocks in Windows C ++中元组的代码块错误 - Codeblock error for tuple in c++ c++ 在 Windows 上使用带有 Mingw 编译器的 iconv - c++ using of iconv on Windows with Mingw compiler 在C ++中使用COM对象与MinGW编译器 - Using COM object in C++ with MinGW compiler MinGW64 和“C 函数 int select(...) 的声明冲突” - MinGW64 and “conflicting declaration of C function int select(…)” 使用mingw64安装wxWidgets - Installation wxWidgets with mingw64 使用mingw64 c ++编译imapi2应用程序时,“ imapi2.h中的错误”声明“ __RPC__range”没有类型” - errors in imapi2.h when compiling imapi2 app with mingw64 c++ “declaration of '__RPC__range' with no type” 尝试使用MinGW64和CMake在stdlib.h“ _wtoi64和其他未在此范围内声明的文件”中制作文件时出错 - Error when trying to make file in stdlib.h “_wtoi64 and others not declared in this scope” using MinGW64 & CMake
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM