Click here to Skip to main content
15,868,016 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
This is my first time using wxwidgets, and encountered some error like some functions haven't defined:
wxEntry, wxAppConsoleBase, ZN9wxtestApp6OnInitEv', and so on.


C++
D:/MyApps/digital_drawing/wxtest/wxtest/wxtestApp.cpp:17: undefined reference to `wxEntry(HINSTANCE__*, HINSTANCE__*, char*, int)'obj\Debug\wxtestApp.o: In function `Z11wxCreateAppv':D:/MyApps/digital_drawing/wxtest/wxtest/wxtestApp.cpp:17: undefined reference to `wxAppConsoleBase::CheckBuildOptions(char const*, char const*)'obj\Debug\wxtestApp.o: In function `ZN9wxtestApp6OnInitEv':D:/MyApps/digital_drawing/wxtest/wxtest/wxtestApp.cpp:23: undefined reference to `wxInitAllImageHandlers()'


Compile and link command:
C++
mingw32-g++.exe -LD:\Dev\CodeBlocks\wxWidgets-3.0.0\lib\gcc_dll  -o bin\Debug\wxtest.exe obj\Debug\wxtestApp.o obj\Debug\wxtestMain.o  obj\Debug\resource.res  -mthreads  ..\..\..\..\Dev\CodeBlocks\wxWidgets-3.0.0\lib\gcc_dll\libwxbase30ud.a ..\..\..\..\Dev\CodeBlocks\wxWidgets-3.0.0\lib\gcc_dll\libwxbase30ud_net.a ..\..\..\..\Dev\CodeBlocks\wxWidgets-3.0.0\lib\gcc_dll\libwxbase30ud_xml.a ..\..\..\..\Dev\CodeBlocks\wxWidgets-3.0.0\lib\gcc_dll\libwxmsw30ud_adv.a ..\..\..\..\Dev\CodeBlocks\wxWidgets-3.0.0\lib\gcc_dll\libwxmsw30ud_aui.a ..\..\..\..\Dev\CodeBlocks\wxWidgets-3.0.0\lib\gcc_dll\libwxmsw30ud_core.a ..\..\..\..\Dev\CodeBlocks\wxWidgets-3.0.0\lib\gcc_dll\libwxmsw30ud_gl.a ..\..\..\..\Dev\CodeBlocks\wxWidgets-3.0.0\lib\gcc_dll\libwxmsw30ud_html.a ..\..\..\..\Dev\CodeBlocks\wxWidgets-3.0.0\lib\gcc_dll\libwxmsw30ud_media.a ..\..\..\..\Dev\CodeBlocks\wxWidgets-3.0.0\lib\gcc_dll\libwxmsw30ud_propgrid.a ..\..\..\..\Dev\CodeBlocks\wxWidgets-3.0.0\lib\gcc_dll\libwxmsw30ud_ribbon.a ..\..\..\..\Dev\CodeBlocks\wxWidgets-3.0.0\lib\gcc_dll\libwxmsw30ud_richtext.a ..\..\..\..\Dev\CodeBlocks\wxWidgets-3.0.0\lib\gcc_dll\libwxmsw30ud_stc.a ..\..\..\..\Dev\CodeBlocks\wxWidgets-3.0.0\lib\gcc_dll\libwxmsw30ud_webview.a ..\..\..\..\Dev\CodeBlocks\wxWidgets-3.0.0\lib\gcc_dll\libwxmsw30ud_xrc.a ..\..\..\..\Dev\CodeBlocks\wxWidgets-3.0.0\lib\gcc_dll\libwxregexud.a  -mwindows 



The command of compiling wxwidgets is as follows, and no error:
mingw32-make -f makefile.gcc BUILD=release SHARED=1 MONOLITHIC=0 UNICODE=1
mingw32-make -f makefile.gcc BUILD=debug SHARED=1 MONOLITHIC=0 UNICODE=1
Posted

1 solution

You are missing an option to name the library file(s) that contain these references. In most cases it would be something like
mingw32-g++.exe -LD:\Dev\CodeBlocks\wxWidgets-3.0.0\lib\gcc_dll  -o bin\Debug\wxtest.exe obj\Debug\wxtestApp.o obj\Debug\wxtestMain.o  obj\Debug\resource.res  -mthreads  -lLIBRARYNAMEGOESHERE
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900