Page 1 of 1

undefined reference

Posted: Tue Nov 29, 2011 2:13 pm
by alancan
Hi,

I just upgrade to wxDevC++ 7.4 and I am attempting to re-compile a program that I wrote in 7.3.1. I am having a Linker Error issue. I have already changed to unicode support. Below is a portion of the Compile log to view the issues, it pretty much repeats the same errors. Any ideas would be greatly appreciated. I compiled with 7.3.1 right before installing 7.4, so I did not change any code in between the installs. I tried re-installing 7.3.1 but it will not work, but that is another issue all together.

Code: Select all

Compiler: Default GCC compiler
Building Makefile: "F:\Alan\Bill\CanFIRE\operational_model\2.0\0.02\Makefile.win"
Executing  make...
mingw32-make.exe -f "Makefile.win" all 
g++.exe "Objects/MingW/CanFIRE-002App.o" "Objects/MingW/CanFIRE-002.o" "Objects/MingW/NewProjDlg.o" "Objects/MingW/tinyxmlparser.o" "Objects/MingW/tinystr.o" "Objects/MingW/tinyxml.o" "Objects/MingW/tinyxmlerror.o" "Objects/MingW/Scenario.o" "Objects/MingW/universe.o" "Objects/MingW/Stand.o" "Objects/MingW/Species.o" "Objects/MingW/ReportFrm.o" "Objects/MingW/AboutDlg.o" "Objects/MingW/validation.o" "Objects/MingW/ecology.o" "Objects/MingW/sqlite3_class.o" "Objects/MingW/fbp.o" "Objects/MingW/SppPercentage.o" "Objects/MingW/newSppDlg.o" "Objects/MingW/newStandDlg.o" "Objects/MingW/disclaimerDlg.o" Objects/MingW/CanFIRE-002_private.res -o "Output/MingW/CanFIRE-002.exe" -L"C:/Program Files/Dev-Cpp/Lib" -mwindows -lwxmsw28u -lwxmsw28u_gl -lwxtiff -lwxjpeg -lwxpng -lwxzlib -lwxregexu -lwxexpat -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lwinspool -lwinmm -lshell32 -lcomctl32 -lole32 -loleaut32 -luuid -lrpcrt4 -ladvapi32 -lwsock32 -lodbc32 -lopengl32 Output/MingW/sqlite3.a  -g3  

Objects/MingW/CanFIRE-002App.o: In function `ZN14CanFIRE_002App6OnInitEv':
C:/Program Files/Dev-Cpp/include/common/wx/string.h:368: undefined reference to `wxStringBase::InitWith(char const*, unsigned int, unsigned int)'
C:/Program Files/Dev-Cpp/include/common/wx/string.h:368: undefined reference to `wxStringBase::InitWith(char const*, unsigned int, unsigned int)'
Objects/MingW/CanFIRE-002App.o: In function `Z8wxGetAppv':
C:/Program Files/Dev-Cpp/include/common/wx/app.h:287: undefined reference to `wxApp::Initialize(int&, char**)'
Objects/MingW/CanFIRE-002.o: In function `ZN11CanFIRE_00218featureUnavailableE8wxString':
C:/Program Files/Dev-Cpp/include/common/wx/string.h:287: undefined reference to `wxStringBase::ConcatSelf(unsigned int, char const*, unsigned int)'
C:/Program Files/Dev-Cpp/include/common/wx/string.h:287: undefined reference to `wxStringBase::ConcatSelf(unsigned int, char const*, unsigned int)'
Objects/MingW/CanFIRE-002.o: In function `ZN11CanFIRE_00215grassTypeScrollER13wxScrollEvent':
F:/Alan/Bill/CanFIRE/operational_model/2.0/0.02/CanFIRE-002.cpp:3753: undefined reference to `wxString::Format(char const*, ...)'
F:/Alan/Bill/CanFIRE/operational_model/2.0/0.02/CanFIRE-002.cpp:3754: undefined reference to `wxString::Format(char const*, ...)'
Objects/MingW/CanFIRE-002.o: In function `ZN11CanFIRE_00222btnEditProjNameOnClickER14wxCommandEvent':
C:/Program Files/Dev-Cpp/include/common/wx/string.h:368: undefined reference to `wxStringBase::InitWith(char const*, unsigned int, unsigned int)'
C:/Program Files/Dev-Cpp/include/common/wx/string.h:368: undefined reference to `wxStringBase::InitWith(char const*, unsigned int, unsigned int)'
Objects/MingW/CanFIRE-002.o: In function `ZN11CanFIRE_00225createStaticProjectLabelsEv':
C:/Program Files/Dev-Cpp/include/common/wx/string.h:368: undefined reference to `wxStringBase::InitWith(char const*, unsigned int, unsigned int)'
C:/Program Files/Dev-Cpp/include/common/wx/string.h:368: undefined reference to `wxStringBase::InitWith(char const*, unsigned int, unsigned int)'
Objects/MingW/CanFIRE-002.o: In function `ZN11CanFIRE_00225createStaticProjectLabelsEv':
F:/Alan/Bill/CanFIRE/operational_model/2.0/0.02/Scenario.h:36: undefined reference to `wxString::Format(char const*, ...)'
Objects/MingW/CanFIRE-002.o: In function `ZN11CanFIRE_00210setBiomassEv':
C:/Program Files/Dev-Cpp/include/common/wx/string.h:965: undefined reference to `wxStringBase::operator=(char const*)'
Objects/MingW/CanFIRE-002.o: In function `ZN11CanFIRE_00211getTotalMWDEv':
C:/Program Files/Dev-Cpp/include/common/wx/string.h:993: undefined reference to `wxString::Format(char const*, ...)'
C:/Program Files/Dev-Cpp/include/common/wx/string.h:287: undefined reference to `wxStringBase::ConcatSelf(unsigned int, char const*, unsigned int)'
Objects/MingW/CanFIRE-002.o: In function `ZN11CanFIRE_00219btnEditStandOnClickER14wxCommandEvent':
C:/Program Files/Dev-Cpp/include/common/wx/string.h:368: undefined reference to `wxStringBase::InitWith(char const*, unsigned int, unsigned int)'
C:/Program Files/Dev-Cpp/include/common/wx/string.h:368: undefined reference to `wxStringBase::InitWith(char const*, unsigned int, unsigned int)'
Objects/MingW/CanFIRE-002.o: In function `ZN11CanFIRE_00219btnEditStandOnClickER14wxCommandEvent':
F:/Alan/Bill/CanFIRE/operational_model/2.0/0.02/Stand.h:37: undefined reference to `wxString::Format(char const*, ...)'
F:/Alan/Bill/CanFIRE/operational_model/2.0/0.02/Stand.h:37: undefined reference to `wxString::Format(char const*, ...)'
F:/Alan/Bill/CanFIRE/operational_model/2.0/0.02/Stand.h:37: undefined reference to `wxString::Format(char const*, ...)'
F:/Alan/Bill/CanFIRE/operational_model/2.0/0.02/Stand.h:37: undefined reference to `wxString::Format(char const*, ...)'
C:/Program Files/Dev-Cpp/include/common/wx/string.h:287: undefined reference to `wxStringBase::ConcatSelf(unsigned int, char const*, unsigned int)'
C:/Program Files/Dev-Cpp/include/common/wx/string.h:993: undefined reference to `wxString::Format(char const*, ...)'
C:/Program Files/Dev-Cpp/include/common/wx/string.h:287: undefined reference to `wxStringBase::ConcatSelf(unsigned int, char const*, unsigned int)'
C:/Program Files/Dev-Cpp/include/common/wx/string.h:993: undefined reference to `wxString::Format(char const*, ...)'
C:/Program Files/Dev-Cpp/include/common/wx/string.h:287: undefined reference to `wxStringBase::ConcatSelf(unsigned int, char const*, unsigned int)'
C:/Program Files/Dev-Cpp/include/common/wx/string.h:993: undefined reference to `wxString::Format(char const*, ...)'
C:/Program Files/Dev-Cpp/include/common/wx/string.h:287: undefined reference to `wxStringBase::ConcatSelf(unsigned int, char const*, unsigned int)'
C:/Program Files/Dev-Cpp/include/common/wx/string.h:993: undefined reference to `wxString::Format(char const*, ...)'
C:/Program Files/Dev-Cpp/include/common/wx/string.h:287: undefined reference to `wxStringBase::ConcatSelf(unsigned int, char const*, unsigned int)'
C:/Program Files/Dev-Cpp/include/common/wx/string.h:993: undefined reference to `wxString::Format(char const*, ...)'
C:/Program Files/Dev-Cpp/include/common/wx/string.h:287: undefined reference to `wxStringBase::ConcatSelf(unsigned int, char const*, unsigned int)'
C:/Program Files/Dev-Cpp/include/common/wx/string.h:993: undefined reference to `wxString::Format(char const*, ...)'
C:/Program Files/Dev-Cpp/include/common/wx/string.h:287: undefined reference to `wxStringBase::ConcatSelf(unsigned int, char const*, unsigned int)'
C:/Program Files/Dev-Cpp/include/common/wx/string.h:993: undefined reference to `wxString::Format(char const*, ...)'

Thank you very much.

Alan

Re: undefined reference

Posted: Tue Nov 29, 2011 6:33 pm
by tbreina
I think you need to add the Unicode flag to your parameters.

Go to Project->Project Options->Parameters. In the Preprocessor definitions box add the line,

Code: Select all

_UNICODE

Then do a Rebuild All.

The _UNICODE flag will tell wxWidgets to compile with Unicode support. The -lwxmsw28u -lwxmsw28u_gl links the Unicode-compiled wxWidgets libs with your Unicode-compiled code.

-Tony

Re: undefined reference

Posted: Tue Nov 29, 2011 10:38 pm
by alancan
Thank you tbreina!

This has resolved my issue, though I had some errors some of my strings that I had not wrapped in wxT() or _T(), but I have resolved those issues and am able to continue working now!

Cheers! :D

Alan