undefined reference error

Do you have a question about makefiles, a compiler or IDE you are using and need to know how to set it up for wxWidgets or why it doesn't compile but other IDE's do ? Post your questions here.
Post Reply
pophu
In need of some credit
In need of some credit
Posts: 1
Joined: Sun Feb 03, 2013 9:52 am

undefined reference error

Post by pophu » Sun Feb 03, 2013 10:05 am

I am new to wxwidget. When building ,we meet the below error.

win7(32bit)+codeblock12.11/mingw+wxwidgets2.9.4

i have compiled wxwidget im my pc. I create a wxwidget project by wizard, with using dll and unicode.

Pls let me how to do.

Code: Select all

||=== test, Debug ===|
D:\CodeBlocks\wxWidgets-2.9.4\lib\libwxmsw29ud_core.a(corelib_app.o)||In function `ZN5wxApp10InitializeERiPPw':|
D:\CodeBlocks\wxWidgets-2.9.4\build\msw\..\..\src\msw\app.cpp|643|undefined reference to `[email protected]'|
D:\CodeBlocks\wxWidgets-2.9.4\lib\libwxmsw29ud_core.a(corelib_app.o)||In function `Z15wxOleInitializev':|
D:\CodeBlocks\wxWidgets-2.9.4\build\msw\..\..\include\wx\msw\ole\oleutils.h|43|undefined reference to `[email protected]'|
D:\CodeBlocks\wxWidgets-2.9.4\lib\libwxmsw29ud_core.a(corelib_app.o)||In function `Z17wxOleUninitializev':|
D:\CodeBlocks\wxWidgets-2.9.4\build\msw\..\..\include\wx\msw\ole\oleutils.h|66|undefined reference to `[email protected]'|
D:\CodeBlocks\wxWidgets-2.9.4\lib\libwxmsw29ud_core.a(corelib_droptgt.o)||In function `ZN12wxDropTarget8RegisterEP6HWND__':|
D:\CodeBlocks\wxWidgets-2.9.4\build\msw\..\..\src\msw\ole\droptgt.cpp|379|undefined reference to `[email protected]'|
D:\CodeBlocks\wxWidgets-2.9.4\build\msw\..\..\src\msw\ole\droptgt.cpp|386|undefined reference to `[email protected]'|
D:\CodeBlocks\wxWidgets-2.9.4\build\msw\..\..\src\msw\ole\droptgt.cpp|390|undefined reference to `[email protected]'|
D:\CodeBlocks\wxWidgets-2.9.4\lib\libwxmsw29ud_core.a(corelib_droptgt.o)||In function `ZN12wxDropTarget6RevokeEP6HWND__':|
D:\CodeBlocks\wxWidgets-2.9.4\build\msw\..\..\src\msw\ole\droptgt.cpp|409|undefined reference to `[email protected]'|
D:\CodeBlocks\wxWidgets-2.9.4\build\msw\..\..\src\msw\ole\droptgt.cpp|417|undefined reference to `[email protected]'|
D:\CodeBlocks\wxWidgets-2.9.4\lib\libwxmsw29ud_core.a(corelib_droptgt.o):droptgt.cpp:(.data+0x0)||undefined reference to `IID_IUnknown'|
D:\CodeBlocks\wxWidgets-2.9.4\lib\libwxmsw29ud_core.a(corelib_droptgt.o):droptgt.cpp:(.data+0x4)||undefined reference to `IID_IDropTarget'|
D:\CodeBlocks\wxWidgets-2.9.4\lib\libwxmsw29ud_core.a(corelib_ownerdrw.o)||In function `Z17wxDrawStateBitmapP5HDC__P9HBITMAP__iij':|
D:\CodeBlocks\wxWidgets-2.9.4\build\msw\..\..\src\msw\ownerdrw.cpp|128|undefined reference to `[email protected]'|
D:\CodeBlocks\wxWidgets-2.9.4\build\msw\..\..\src\msw\ownerdrw.cpp|129|undefined reference to `[email protected]'|
D:\CodeBlocks\wxWidgets-2.9.4\build\msw\..\..\src\msw\ownerdrw.cpp|131|undefined reference to `[email protected]'|
D:\CodeBlocks\wxWidgets-2.9.4\build\msw\..\..\src\msw\ownerdrw.cpp|132|undefined reference to `[email protected]'|
D:\CodeBlocks\wxWidgets-2.9.4\lib\libwxmsw29ud_core.a(corelib_msw_textctrl.o)||In function `ZN10wxTextCtrl13SetDropTargetEP12wxDropTarget':|
D:\CodeBlocks\wxWidgets-2.9.4\build\msw\..\..\src\msw\textctrl.cpp|2358|undefined reference to `[email protected]'|
D:\CodeBlocks\wxWidgets-2.9.4\lib\libwxmsw29ud_core.a(corelib_msw_spinbutt.o)||In function `ZN12wxSpinButton6CreateEP8wxWindowiRK7wxPointRK6wxSizelRK8wxString':|
D:\CodeBlocks\wxWidgets-2.9.4\build\msw\..\..\src\msw\spinbutt.cpp|120|undefined reference to `[email protected]'|
D:\CodeBlocks\wxWidgets-2.9.4\lib\libwxmsw29ud_core.a(corelib_textentry.o):textentry.cpp:(.data+0x0)||undefined reference to `IID_IUnknown'|
D:\CodeBlocks\wxWidgets-2.9.4\lib\libwxmsw29ud_core.a(corelib_textentry.o):textentry.cpp:(.data+0x4)||undefined reference to `IID_IEnumString'|
D:\CodeBlocks\wxWidgets-2.9.4\lib\libwxmsw29ud_core.a(corelib_textentry.o)||In function `[email protected]':|
D:\CodeBlocks\wxWidgets-2.9.4\build\msw\..\..\src\msw\textentry.cpp|198|undefined reference to `[email protected]'|
D:\CodeBlocks\wxWidgets-2.9.4\lib\libwxmsw29ud_core.a(corelib_textentry.o)||In function `ZN22wxTextAutoCompleteDataC1EP11wxTextEntry':|
D:\CodeBlocks\wxWidgets-2.9.4\build\msw\..\..\src\msw\textentry.cpp|381|undefined reference to `[email protected]'|
D:\CodeBlocks\wxWidgets-2.9.4\lib\libwxmsw29ud_core.a(corelib_oleutils.o)||In function `Z22wxConvertStringFromOlePw':|
D:\CodeBlocks\wxWidgets-2.9.4\build\msw\..\..\src\msw\ole\oleutils.cpp|83|undefined reference to `[email protected]'|
D:\CodeBlocks\wxWidgets-2.9.4\lib\libwxmsw29ud_core.a(corelib_oleutils.o)||In function `ZN13wxBasicStringC2ERK8wxString':|
D:\CodeBlocks\wxWidgets-2.9.4\build\msw\..\..\src\msw\ole\oleutils.cpp|108|undefined reference to `[email protected]'|
D:\CodeBlocks\wxWidgets-2.9.4\lib\libwxmsw29ud_core.a(corelib_oleutils.o)||In function `ZN13wxBasicStringaSERKS_':|
D:\CodeBlocks\wxWidgets-2.9.4\build\msw\..\..\src\msw\ole\oleutils.cpp|118|undefined reference to `[email protected]'|
D:\CodeBlocks\wxWidgets-2.9.4\lib\libwxmsw29ud_core.a(corelib_oleutils.o)||In function `ZN13wxBasicStringD2Ev':|
D:\CodeBlocks\wxWidgets-2.9.4\build\msw\..\..\src\msw\ole\oleutils.cpp|124|undefined reference to `[email protected]'|
D:\CodeBlocks\wxWidgets-2.9.4\lib\libwxmsw29ud_core.a(corelib_oleutils.o)||In function `~wxSafeArrayHelper':|
D:\CodeBlocks\wxWidgets-2.9.4\build\msw\..\..\src\msw\ole\oleutils.cpp|169|undefined reference to `[email protected]'|
D:\CodeBlocks\wxWidgets-2.9.4\lib\libwxmsw29ud_core.a(corelib_oleutils.o)||In function `Create':|
D:\CodeBlocks\wxWidgets-2.9.4\build\msw\..\..\src\msw\ole\oleutils.cpp|179|undefined reference to `[email protected]'|
D:\CodeBlocks\wxWidgets-2.9.4\build\msw\..\..\src\msw\ole\oleutils.cpp|182|undefined reference to `[email protected]'|
D:\CodeBlocks\wxWidgets-2.9.4\lib\libwxmsw29ud_core.a(corelib_oleutils.o)||In function `Unlock':|
D:\CodeBlocks\wxWidgets-2.9.4\build\msw\..\..\src\msw\ole\oleutils.cpp|218|undefined reference to `[email protected]'|
D:\CodeBlocks\wxWidgets-2.9.4\lib\libwxmsw29ud_core.a(corelib_oleutils.o)||In function `Z21wxConvertVariantToOleRK9wxVariantR10tagVARIANT':|
D:\CodeBlocks\wxWidgets-2.9.4\build\msw\..\..\src\msw\ole\oleutils.cpp|226|undefined reference to `[email protected]'|
D:\CodeBlocks\wxWidgets-2.9.4\build\msw\..\..\src\msw\ole\oleutils.cpp|284|undefined reference to `[email protected]'|
D:\CodeBlocks\wxWidgets-2.9.4\lib\libwxmsw29ud_core.a(corelib_oleutils.o)||In function `Z21wxConvertOleToVariantRK10tagVARIANTR9wxVariant':|
D:\CodeBlocks\wxWidgets-2.9.4\build\msw\..\..\src\msw\ole\oleutils.cpp|351|undefined reference to `[email protected]'|
D:\CodeBlocks\wxWidgets-2.9.4\build\msw\..\..\src\msw\ole\oleutils.cpp|399|undefined reference to `[email protected]'|
D:\CodeBlocks\wxWidgets-2.9.4\build\msw\..\..\src\msw\ole\oleutils.cpp|434|undefined reference to `[email protected]'|
D:\CodeBlocks\wxWidgets-2.9.4\lib\libwxmsw29ud_core.a(corelib_oleutils.o)||In function `ZNK13wxBasicString3GetEv':|
D:\CodeBlocks\wxWidgets-2.9.4\build\msw\..\..\include\wx\msw\ole\oleutils.h|229|undefined reference to `[email protected]'|
D:\CodeBlocks\wxWidgets-2.9.4\lib\libwxmsw29ud_core.a(corelib_imaglist.o)||In function `ZN11wxImageList6CreateEiibi':|
D:\CodeBlocks\wxWidgets-2.9.4\build\msw\..\..\src\msw\imaglist.cpp|96|undefined reference to `[email protected]'|
D:\CodeBlocks\wxWidgets-2.9.4\lib\libwxmsw29ud_core.a(corelib_imaglist.o)||In function `ZN11wxImageListD2Ev':|
D:\CodeBlocks\wxWidgets-2.9.4\build\msw\..\..\src\msw\imaglist.cpp|109|undefined reference to `[email protected]'|
D:\CodeBlocks\wxWidgets-2.9.4\lib\libwxmsw29ud_core.a(corelib_imaglist.o)||In function `ZNK11wxImageList13GetImageCountEv':|
D:\CodeBlocks\wxWidgets-2.9.4\build\msw\..\..\src\msw\imaglist.cpp|123|undefined reference to `[email protected]'|
D:\CodeBlocks\wxWidgets-2.9.4\lib\libwxmsw29ud_core.a(corelib_imaglist.o)||In function `ZNK11wxImageList7GetSizeEiRiS0_':|
D:\CodeBlocks\wxWidgets-2.9.4\build\msw\..\..\src\msw\imaglist.cpp|131|undefined reference to `[email protected]'|
D:\CodeBlocks\wxWidgets-2.9.4\lib\libwxmsw29ud_core.a(corelib_imaglist.o)||In function `ZN11wxImageList3AddERK8wxBitmapS2_':|
D:\CodeBlocks\wxWidgets-2.9.4\build\msw\..\..\src\msw\imaglist.cpp|164|undefined reference to `[email protected]'|
D:\CodeBlocks\wxWidgets-2.9.4\lib\libwxmsw29ud_core.a(corelib_imaglist.o)||In function `ZN11wxImageList3AddERK8wxBitmapRK8wxColour':|
D:\CodeBlocks\wxWidgets-2.9.4\build\msw\..\..\src\msw\imaglist.cpp|195|undefined reference to `[email protected]'|
D:\CodeBlocks\wxWidgets-2.9.4\lib\libwxmsw29ud_core.a(corelib_imaglist.o)||In function `ZN11wxImageList3AddERK6wxIcon':|
D:\CodeBlocks\wxWidgets-2.9.4\build\msw\..\..\src\msw\imaglist.cpp|207|undefined reference to `[email protected]'|
D:\CodeBlocks\wxWidgets-2.9.4\lib\libwxmsw29ud_core.a(corelib_imaglist.o)||In function `ZN11wxImageList7ReplaceEiRK8wxBitmapS2_':|
D:\CodeBlocks\wxWidgets-2.9.4\build\msw\..\..\src\msw\imaglist.cpp|240|undefined reference to `[email protected]'|
D:\CodeBlocks\wxWidgets-2.9.4\lib\libwxmsw29ud_core.a(corelib_imaglist.o)||In function `ZN11wxImageList7ReplaceEiRK6wxIcon':|
D:\CodeBlocks\wxWidgets-2.9.4\build\msw\..\..\src\msw\imaglist.cpp|252|undefined reference to `[email protected]'|
D:\CodeBlocks\wxWidgets-2.9.4\lib\libwxmsw29ud_core.a(corelib_imaglist.o)||In function `ZN11wxImageList6RemoveEi':|
D:\CodeBlocks\wxWidgets-2.9.4\build\msw\..\..\src\msw\imaglist.cpp|264|undefined reference to `[email protected]'|
D:\CodeBlocks\wxWidgets-2.9.4\lib\libwxmsw29ud_core.a(corelib_imaglist.o)||In function `ZN11wxImageList4DrawEiR4wxDCiiib':|
D:\CodeBlocks\wxWidgets-2.9.4\build\msw\..\..\src\msw\imaglist.cpp|308|undefined reference to `[email protected]'|
D:\CodeBlocks\wxWidgets-2.9.4\build\msw\..\..\src\msw\imaglist.cpp|320|undefined reference to `[email protected]'|
D:\CodeBlocks\wxWidgets-2.9.4\lib\libwxmsw29ud_core.a(corelib_imaglist.o)||In function `ZNK11wxImageList7GetIconEi':|
D:\CodeBlocks\wxWidgets-2.9.4\build\msw\..\..\src\msw\imaglist.cpp|372|undefined reference to `[email protected]'|
D:\CodeBlocks\wxWidgets-2.9.4\lib\libwxmsw29ud_core.a(corelib_msw_listctrl.o)||In function `HandleSubItemPrepaint':|
D:\CodeBlocks\wxWidgets-2.9.4\build\msw\..\..\src\msw\listctrl.cpp|2681|undefined reference to `ImageLis[email protected]'|
D:\CodeBlocks\wxWidgets-2.9.4\build\msw\..\..\src\msw\listctrl.cpp|2687|undefined reference to `[email protected]'|
D:\CodeBlocks\wxWidgets-2.9.4\build\msw\..\..\src\msw\listctrl.cpp|2697|undefined reference to `[email protected]'|
||More errors follow but not being shown.|
||Edit the max errors limit in compiler options...|
||=== Build finished: 50 errors, 0 warnings (0 minutes, 17 seconds) ===|


maxbld
Earned some good credits
Earned some good credits
Posts: 111
Joined: Wed Jan 30, 2013 10:49 pm

Re: undefined reference error

Post by maxbld » Fri Feb 08, 2013 12:34 am

are you sure you compiled wxWidgets library with the same compiler that you set in codeblocks?

BR,
Max.

User avatar
doublemax
Moderator
Moderator
Posts: 14300
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: undefined reference error

Post by doublemax » Fri Feb 08, 2013 1:21 am

All the missing references are internal Windows function. So you're missing the Windows libs. As i don't use CodeBlocks or MingW, i can't tell you how exactly to fix this.

Googling told me that the libs are added when you add the "-mwindows" linker switch. Try searching in that direction.
Use the source, Luke!

Post Reply