c++ - 无法使用 MinGW 构建 wxMSW-2.8.12

标签 c++ mingw wxwidgets mingw32

<分区>

我尝试了两种不同版本的 gcc(4.6 和 4.7),其中包含多种配置

make -f makefile.gcc USE_OPENGL=1 BUILD=debug SHARED=0 RUNTIME_LIBS=static UNICODE=1
make -f makefile.gcc MONOLITHIC=1 BUILD=debug SHARED=0 UNICODE=1
make -f makefile.gcc USE_OPENGL=1 BUILD=debug UNICODE=1

这是错误

../../src/msw/thread.cpp:525: error: cast from 'void*' to 'THREAD_RETVAL' loses precision
../../src/msw/thread.cpp: In member function 'wxThreadError wxThreadInternal::WaitForTerminate(wxCriticalSection&, void**, wxThread*)':
../../src/msw/thread.cpp:845: error: cast from 'void*' to 'DWORD' loses precision
../../src/msw/thread.cpp: In member function 'void wxThread::Exit(void*)':
../../src/msw/thread.cpp:1165: error: cast from 'void*' to 'unsigned int' loses precision

我的平台是 Windows 7 64 位,但我没有尝试构建 64 位库(无论如何都不是故意的)
我做错了什么?

最佳答案

DWORD 是 32 位值,而在 64 位架构上,指针是 64 位值。该代码应该使用 DWORD_PTR,它在 x86_64 上定义为 64 位值,在 x86 上定义为 32 位值。 可能您应该将其构建为 32 位应用程序,并避免尝试将其构建为 native 64 位应用程序。

关于c++ - 无法使用 MinGW 构建 wxMSW-2.8.12,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10350974/

相关文章:

C++每个派生类中的不同常量成员,如何移动函数以消除访问中的重复?

c++ - 在插入其他线程时有效地遍历 map

c++ - 在 Ubuntu 系统日志中检索 wxLogSysError

c++ - OSX 上的空 wxWidgets 菜单

c++ - 从命令行编译 wxWidgets

c++ - 在 C++ 中将数组保存到文件

c++ - system() 函数找不到可执行文件的可能原因是什么?

c - undefined reference `WinMain@16'collect2.exe : error: ld returned 1 exit status

windows - 找不到用于 mingw sh autogen.sh 执行的 aclocal

c++ - 使用 C++ 合并静态库时出现 undefined reference 错误