Author Topic: undefined reference with wxWidgets 3.1 wizard  (Read 997 times)

Offline cledou

  • Single posting newcomer
  • *
  • Posts: 8
undefined reference with wxWidgets 3.1 wizard
« on: March 02, 2018, 05:40:52 pm »
Hello.
I try to execute the wxWidget example from new->project->wxWidgets 3.1.x, but have an error:
Code: [Select]
mingw32-g++.exe -LC:\wx311\lib\gcc_lib -o bin\Debug\test.exe  obj\Debug\testApp.o obj\Debug\testMain.o obj\Debug\resource.res -mthreads  -lwxmsw31ud -lwxpngd -lwxjpegd -lwxtiffd -lwxzlibd -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lcomctl32 -lwsock32 -lodbc32 -lshlwapi -lversion -mwindows
C:\wx311\lib\gcc_lib/libwxmsw31ud.a(monolib_statusbar.o): In function `ZNK11wxStatusBar12GetFieldRectEiR6wxRect':
C:\wx311\build\msw/../../src/msw/statusbar.cpp:455: undefined reference to `GetThemeBackgroundContentRect@24'
C:\wx311\lib\gcc_lib/libwxmsw31ud.a(monolib_statusbar.o): In function `ZN15wxUxThemeHandleC1EPK8wxWindowPKw':
C:\wx311\build\msw/../../include/wx/msw/uxtheme.h:234: undefined reference to `OpenThemeData@8'
I have compiled my wx311 librairies with the gcc tdm 5.1 of codeblocks, with the switch MONOLITHIC=1
Does anybody have an idea about this problem ?

Edit: Sorry, the problem does not come from codeblocks, but from wxWidgets: the same project works perfectly with wx 3.1.0, but not with wxWidgets 3.1.1
« Last Edit: March 02, 2018, 05:47:49 pm by cledou »

Offline Miguel Gimenez

  • Almost regular
  • **
  • Posts: 139
Re: undefined reference with wxWidgets 3.1 wizard
« Reply #1 on: March 02, 2018, 06:07:27 pm »
wxWidgets 3.1.1 removed automatic linking with uxtheme library, so you should add it to the linker settings near shlwapi or wsock32.

Offline cledou

  • Single posting newcomer
  • *
  • Posts: 8
Re: undefined reference with wxWidgets 3.1 wizard
« Reply #2 on: March 02, 2018, 06:38:29 pm »
Thanks, it was that. In fact, there is 2 librairies missing: -loleacc -lUxTheme