我已经在Eclipse中构建了一个已经运行的c ++ + wxWidgets应用程序,并使用MSYS构建了wxWidgets。
现在我想尝试不同的IDE,比如CodeLite和Code :: Blocks,但是当我尝试它们时它们没有用,因为我缺少他们想要的build.cfg文件。 所以我尝试了一种“干净”的方式,备份了wxWidgets并使用MinGW32-make而不是MSYS再次构建它们。
尝试代码:阻止现在,我得到了很多“未定义的引用”错误,我无法理解我做了什么或设置错误。
我会尝试在此提供所有相关信息:
wxWidgets的路径:
C:\SVILUPPO\TOOLS\wxWidgets
路径变量(相关部分)
PATH=C:\SVILUPPO\TOOLS\MinGW\bin;C:\SVILUPPO\TOOLS\MinGW\libexec\gcc\mingw32\4.8.1;
Mingw v4.8.1,make version
C:\SVILUPPO\TOOLS\wxWidgets>mingw32-make -v
GNU Make 3.82.90
Built for i686-pc-mingw32
wxWidgets构建命令:
C:\SVILUPPO\TOOLS\wxWidgets\build\msw>mingw32-make -f makefile.gcc BUILD=debug UNICODE=1 SHARED=0 MONOLITHIC=1
Code :: Block build log:
-------------- Build: Debug in MyProject (compiler: GNU GCC Compiler)---------------
mingw32-g++.exe -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DwxUSE_UNICODE -Wall -g -D__WXDEBUG__ -IC:\SVILUPPO\TOOLS\wxWidgets\lib\gcc_lib\mswud -IC:\SVILUPPO\TOOLS\wxWidgets\include -c C:\Source\Codeblocks\Progetti\MyProject\MyProject\src\CustomControls\TAntiAliasedGauge\TAntiAliasedGauge.cpp -o obj\Debug\src\CustomControls\TAntiAliasedGauge\TAntiAliasedGauge.o
mingw32-g++.exe -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DwxUSE_UNICODE -Wall -g -D__WXDEBUG__ -IC:\SVILUPPO\TOOLS\wxWidgets\lib\gcc_lib\mswud -IC:\SVILUPPO\TOOLS\wxWidgets\include -c C:\Source\Codeblocks\Progetti\MyProject\MyProject\src\fMainForm.cpp -o obj\Debug\src\fMainForm.o
mingw32-g++.exe -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DwxUSE_UNICODE -Wall -g -D__WXDEBUG__ -IC:\SVILUPPO\TOOLS\wxWidgets\lib\gcc_lib\mswud -IC:\SVILUPPO\TOOLS\wxWidgets\include -c C:\Source\Codeblocks\Progetti\MyProject\MyProject\src\GUI_MainForm.cpp -o obj\Debug\src\GUI_MainForm.o
mingw32-g++.exe -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DwxUSE_UNICODE -Wall -g -D__WXDEBUG__ -IC:\SVILUPPO\TOOLS\wxWidgets\lib\gcc_lib\mswud -IC:\SVILUPPO\TOOLS\wxWidgets\include -c C:\Source\Codeblocks\Progetti\MyProject\MyProject\src\My_Project.cpp -o obj\Debug\src\My_Project.o
mingw32-g++.exe -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DwxUSE_UNICODE -Wall -g -D__WXDEBUG__ -IC:\SVILUPPO\TOOLS\wxWidgets\lib\gcc_lib\mswud -IC:\SVILUPPO\TOOLS\wxWidgets\include -c C:\Source\Codeblocks\Progetti\MyProject\MyProject\src\Prova_wxcrafter_bitmaps.cpp -o obj\Debug\src\Prova_wxcrafter_bitmaps.o
mingw32-g++.exe -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DwxUSE_UNICODE -Wall -g -D__WXDEBUG__ -IC:\SVILUPPO\TOOLS\wxWidgets\lib\gcc_lib\mswud -IC:\SVILUPPO\TOOLS\wxWidgets\include -c C:\Source\Codeblocks\Progetti\MyProject\MyProject\src\Utilities\Utilities.cpp -o obj\Debug\src\Utilities\Utilities.o
C:\Source\Codeblocks\Progetti\MyProject\MyProject\src\Utilities\Utilities.cpp: In function 'char HexToChar(char*)':
C:\Source\Codeblocks\Progetti\MyProject\MyProject\src\Utilities\Utilities.cpp:73:66: warning: operation on 'HexString' may be undefined [-Wsequence-point]
return (char)((AscHex(*HexString++) * 16) | AscHex(*HexString++));
^
C:\Source\Codeblocks\Progetti\MyProject\MyProject\src\Utilities\Utilities.cpp: In function 'byte HexToByte(char*)':
C:\Source\Codeblocks\Progetti\MyProject\MyProject\src\Utilities\Utilities.cpp:77:66: warning: operation on 'HexString' may be undefined [-Wsequence-point]
return (byte)((AscHex(*HexString++) * 16) | AscHex(*HexString++));
^
mingw32-g++.exe -LC:\SVILUPPO\TOOLS\wxWidgets\lib\gcc_lib -o bin\Debug\MyProject.exe obj\Debug\src\CustomControls\TAntiAliasedGauge\TAntiAliasedGauge.o obj\Debug\src\fMainForm.o obj\Debug\src\GUI_MainForm.o obj\Debug\src\My_Project.o obj\Debug\src\Prova_wxcrafter_bitmaps.o obj\Debug\src\Utilities\Utilities.o -mthreads -lwxmsw30ud -lwxpngd -lwxjpegd -lwxtiffd -lwxzlibd -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lcomctl32 -lwsock32 -lodbc32 -mwindows
C:\SVILUPPO\TOOLS\wxWidgets\lib\gcc_lib/libwxmsw30ud.a(monolib_xml.o): In function `StartElementHnd':
C:\SVILUPPO\TOOLS\wxWidgets\build\msw/../../src/xml/xml.cpp:637: undefined reference to `XML_GetCurrentLineNumber'
C:\SVILUPPO\TOOLS\wxWidgets\lib\gcc_lib/libwxmsw30ud.a(monolib_xml.o): In function `TextHnd':
C:\SVILUPPO\TOOLS\wxWidgets\build\msw/../../src/xml/xml.cpp:687: undefined reference to `XML_GetCurrentLineNumber'
C:\SVILUPPO\TOOLS\wxWidgets\lib\gcc_lib/libwxmsw30ud.a(monolib_xml.o): In function `StartCdataHnd':
C:\SVILUPPO\TOOLS\wxWidgets\build\msw/../../src/xml/xml.cpp:702: undefined reference to `XML_GetCurrentLineNumber'
C:\SVILUPPO\TOOLS\wxWidgets\lib\gcc_lib/libwxmsw30ud.a(monolib_xml.o): In function `CommentHnd':
C:\SVILUPPO\TOOLS\wxWidgets\build\msw/../../src/xml/xml.cpp:727: undefined reference to `XML_GetCurrentLineNumber'
C:\SVILUPPO\TOOLS\wxWidgets\lib\gcc_lib/libwxmsw30ud.a(monolib_xml.o): In function `PIHnd':
C:\SVILUPPO\TOOLS\wxWidgets\build\msw/../../src/xml/xml.cpp:742: undefined reference to `XML_GetCurrentLineNumber'
C:\SVILUPPO\TOOLS\wxWidgets\lib\gcc_lib/libwxmsw30ud.a(monolib_xml.o): In function `ZN13wxXmlDocument4LoadER13wxInputStreamRK8wxStringi':
C:\SVILUPPO\TOOLS\wxWidgets\build\msw/../../src/xml/xml.cpp:813: undefined reference to `XML_ParserCreate'
C:\SVILUPPO\TOOLS\wxWidgets\build\msw/../../src/xml/xml.cpp:826: undefined reference to `XML_SetUserData'
C:\SVILUPPO\TOOLS\wxWidgets\build\msw/../../src/xml/xml.cpp:827: undefined reference to `XML_SetElementHandler'
C:\SVILUPPO\TOOLS\wxWidgets\build\msw/../../src/xml/xml.cpp:828: undefined reference to `XML_SetCharacterDataHandler'
C:\SVILUPPO\TOOLS\wxWidgets\build\msw/../../src/xml/xml.cpp:829: undefined reference to `XML_SetCdataSectionHandler'
C:\SVILUPPO\TOOLS\wxWidgets\build\msw/../../src/xml/xml.cpp:830: undefined reference to `XML_SetCommentHandler'
C:\SVILUPPO\TOOLS\wxWidgets\build\msw/../../src/xml/xml.cpp:831: undefined reference to `XML_SetProcessingInstructionHandler'
C:\SVILUPPO\TOOLS\wxWidgets\build\msw/../../src/xml/xml.cpp:832: undefined reference to `XML_SetDefaultHandler'
C:\SVILUPPO\TOOLS\wxWidgets\build\msw/../../src/xml/xml.cpp:833: undefined reference to `XML_SetUnknownEncodingHandler'
C:\SVILUPPO\TOOLS\wxWidgets\build\msw/../../src/xml/xml.cpp:840: undefined reference to `XML_Parse'
C:\SVILUPPO\TOOLS\wxWidgets\build\msw/../../src/xml/xml.cpp:843: undefined reference to `XML_GetErrorCode'
C:\SVILUPPO\TOOLS\wxWidgets\build\msw/../../src/xml/xml.cpp:843: undefined reference to `XML_ErrorString'
C:\SVILUPPO\TOOLS\wxWidgets\build\msw/../../src/xml/xml.cpp:846: undefined reference to `XML_GetCurrentLineNumber'
C:\SVILUPPO\TOOLS\wxWidgets\build\msw/../../src/xml/xml.cpp:865: undefined reference to `XML_ParserFree'
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 29 second(s))
19 error(s), 2 warning(s) (0 minute(s), 29 second(s))
我还尝试在链接器设置中添加我在arm-linux下构建此代码时必须添加的其他库,但这些库文件不存在(我猜是因为MONOLITHIC选项):
libwxmsw30ud_core.a
libwxmsw30ud_html.a
libwxmsw30ud_adv.a
libwxbase30ud_xml.a
libwxmsw30ud_richtext.a
最后,我不知道最后应该从Code :: Block链接和调试我的源代码。
答案 0 :(得分:1)
您需要链接在构建wxWidgets时创建的libwxexpat.a
。