无法在 WXWIDGETS Windows 10 中编译调试

failed to compile debug in wxwidgets windows 10

本文关键字:编译 调试 Windows WXWIDGETS      更新时间:2023-10-16

我想跨多个平台开发应用程序。我是wxwidgets的新手。我想编译调试,但它会产生错误。这是我的命令结果。请帮助我。到目前为止,我已经使用 WPF MVVM C# 完成了应用程序,但它只能在 Windows 环境中运行。所以我正在改用 C++,知道它可以在任何环境中编译。请帮助我。

C:wxWidgets-3.0.2buildmsw>mingw32-make SHELL=CMD.exe -f makefile.gcc USE_XRC=1 BUILD=debug UNICODE=1 SHARED=1 MONOLITHIC=1 USE_OPENGL=1 VENDOR=cb CXXFLAGS="-fno-keep-inline-dllexport"
if not exist ....libgcc_dllmswud mkdir ....libgcc_dllmswud
g++ -c -o gcc_mswuddllmonodll_any.o -g -O0 -mthreads  -DHAVE_W32API_H -D__WXMSW__       -D_UNICODE  -I....libgcc_dllmswud -I....include  -W -Wall -DWXBUILDING -I....srctifflibtiff -I....srcjpeg -I....srcpng -I....srczlib -I....srcregex -I....srcexpatlib -I....srcstcscintillainclude -I....srcstcscintillalexlib -I....srcstcscintillasrc -D__WX__ -DSCI_LEXER -DLINK_LEXERS -DwxUSE_BASE=1 -DWXMAKINGDLL   -Wno-ctor-dtor-privacy  -fno-keep-inline-dllexport -MTgcc_mswuddllmonodll_any.o -MFgcc_mswuddllmonodll_any.o.d -MD -MP ../../src/common/any.cpp
In file included from C:/TDM-GCC-32/lib/gcc/mingw32/5.1.0/include/c++/type_traits:35:0,
from ....include/wx/strvararg.h:25,
from ....include/wx/string.h:46,
from ....include/wx/any.h:19,
from ../../src/common/any.cpp:18:
C:/TDM-GCC-32/lib/gcc/mingw32/5.1.0/include/c++/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
#error This file requires compiler and library support for the 
^
In file included from ....include/wx/string.h:46:0,
from ....include/wx/any.h:19,
from ../../src/common/any.cpp:18:
....include/wx/strvararg.h:350:18: error: 'is_enum' in namespace 'std' does not name a template type
typedef std::is_enum<T> is_enum;
^
....include/wx/strvararg.h:354:54: error: 'is_enum' was not declared in this scope
enum { value = wxFormatStringSpecifierNonPodType<is_enum::value>::value };
^
....include/wx/strvararg.h:354:68: error: template argument 1 is invalid
enum { value = wxFormatStringSpecifierNonPodType<is_enum::value>::value };
^
makefile.gcc:6428: recipe for target 'gcc_mswuddllmonodll_any.o' failed
mingw32-make: *** [gcc_mswuddllmonodll_any.o] Error 1
C:wxWidgets-3.0.2buildmsw>

您是否一直按照通常的构建说明进行操作而没有任何更改?一些非常奇怪的事情正在发生,因为HAVE_TYPE_TRAITS以某种方式为您定义(查看文件中的条件wx/strvararg.h错误指向您的行上方(,但未修改的 wxWidgets 源不应该是这种情况,因为它仅在使用 C++11 时定义,即当__cplusplus >= 201103L时,但您使用的编译器 (g++ 5.1( 默认情况下__cplusplus定义为199711L

如果您尝试以不同的方式构建它,例如使用 configure,则必须在再次构建之前清理所有内容,即只需销毁整个源目录并重新展开存档(如果您已下载它(或git clean -fdx如果您克隆了 Git 存储库。

您需要将C++标准设置为 11。将-std=c++11添加到编译命令行(我没有粘贴整行,因为它很长。

mingw32-make SHELL=CMD.exe -f makefile.gcc -std=c++11 USE_XRC=1 BUILD=debug U...