簡體   English   中英

無法在wxwidgets Windows 10中編譯調試

[英]failed to compile debug in wxwidgets windows 10

我想跨多個平台開發應用程序。 我是wxwidgets的新手。 我想編譯調試,但是會產生錯誤。 這是我的命令結果。 請幫我。 到目前為止,我已經使用wpf mvvm c#完成了應用程序,但只能在Windows env中運行。 因此我在知道可以在任何環境中進行編譯的情況下更改為c ++。 請幫我。

C:\wxWidgets-3.0.2\build\msw>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 ..\..\lib\gcc_dll\mswud mkdir ..\..\lib\gcc_dll\mswud
g++ -c -o gcc_mswuddll\monodll_any.o -g -O0 -mthreads  -DHAVE_W32API_H -D__WXMSW__       -D_UNICODE  -I..\..\lib\gcc_dll\mswud -I..\..\include  -W -Wall -DWXBUILDING -I..\..\src\tiff\libtiff -I..\..\src\jpeg -I..\..\src\png -I..\..\src\zlib -I..\..\src\regex -I..\..\src\expat\lib -I..\..\src\stc\scintilla\include -I..\..\src\stc\scintilla\lexlib -I..\..\src\stc\scintilla\src -D__WX__ -DSCI_LEXER -DLINK_LEXERS -DwxUSE_BASE=1 -DWXMAKINGDLL   -Wno-ctor-dtor-privacy  -fno-keep-inline-dllexport -MTgcc_mswuddll\monodll_any.o -MFgcc_mswuddll\monodll_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_mswuddll\monodll_any.o' failed
mingw32-make: *** [gcc_mswuddll\monodll_any.o] Error 1

C:\wxWidgets-3.0.2\build\msw>

您需要將C ++標准設置為11。將-std=c++11添加到您的編譯命令行中(我沒有粘貼整行,因為它很長。):

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

您是否按照常規的構建說明進行了任何更改? 正在發生某種極其奇怪的事情,因為為您定義了HAVE_TYPE_TRAITS (請查看錯誤指向您的行上方的wx/strvararg.h文件中的條件),但是未修改的wxWidgets則不應該如此來源,因為它僅在使用C ++ 11時定義,即當__cplusplus >= 201103L__cplusplus >= 201103L ,但是您使用的編譯器(g ++ 5.1)默認情況下將__cplusplus定義為199711L

如果您嘗試以其他方式構建它,例如使用configure,則必須在重新構建它之前清理所有內容,即,只要下載了文件,就破壞整個源目錄並重新擴展歸檔文件;如果已克隆,則執行git clean -fdx Git存儲庫。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM