News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

Using CB with wxWidgets 3.1.2 - Anyone having problems?

Started by blinkinhek, January 29, 2019, 05:40:22 PM

Previous topic - Next topic

blinkinhek

I downloaded wxWidgets 3.1.2, and after a few issues (resolved in the wxWidgets community forum) got the libraries built for Windows 32 bit. My first port-of-call is always the CB simple Frame-based demo using the CB wxWidgets wizard.  This builds and runs without issue in wxWidgets 3.0.4.  However, with 3.1.2 I get a number of linker errors:
-------------- Build: Debug in test (compiler: GNU GCC Compiler)---------------

i686-w64-mingw32-g++.exe -LC:\wxWidgets-3.1.2\lib\gcc_lib -o bin\Debug\test.exe  obj\Debug\testApp.o obj\Debug\testMain.o obj\Debug\resource.res -mthreads  -lwxmsw31ud_adv -lwxmsw31ud_core -lwxbase31ud -lwxpngd -lwxzlibd -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lcomctl32 -lwsock32 -lodbc32 -lshlwapi -lversion -mwindows
C:\wxWidgets-3.1.2\lib\gcc_lib/libwxmsw31ud_core.a(corelib_window.o): In function `ZN8wxWindow16MSWHandleMessageEPljjl':
C:\wxWidgets-3.1.2\build\msw/../../src/msw/window.cpp:3537: undefined reference to `LresultFromObject@12'
C:\wxWidgets-3.1.2\build\msw/../../src/msw/window.cpp:3733: undefined reference to `_imp__GetThemeBackgroundContentRect@24'
C:\wxWidgets-3.1.2\build\msw/../../src/msw/window.cpp:3773: undefined reference to http://forums.next.codeblocks.org/Themes/default/images/bbc/code.gif`_imp__GetThemeBackgroundContentRect@24'
C:\wxWidgets-3.1.2\build\msw/../../src/msw/window.cpp:3781: undefined reference to `_imp__IsThemeBackgroundPartiallyTransparent@12'
C:\wxWidgets-3.1.2\build\msw/../../src/msw/window.cpp:3783: undefined reference to `_imp__DrawThemeParentBackground@12'
C:\wxWidgets-3.1.2\build\msw/../../src/msw/window.cpp:3795: undefined reference to `_imp__DrawThemeBackground@24'
etc
etc


As you can see, I am using a separate mingw toolset.  However the same errors occur if I just build wxWidgets, and the CB sample, using the default mingw that I installed with the CB download.  I have tried allsorts .... and am sure there is a flag or setting in CB that needs to be different.
I have been careful to setup the Compiler toolchain executable definitions and the Global wx variable to point at wxWidgets 3.1.2

TIA

Miguel Gimenez

wxWidgets 3.1.2 emptied the advanced library (so you can get rid of wxmsw31ud_adv) and removed automatic linking to some libraries, p.e. libuxtheme and liboleacc. Add those libraries (they are in the MinGW folder) to the project and try again.

blinkinhek

Many thanks Miguel - worked a charm.
Now I eed to check I can build my main project! (and add the gesture stuff I was after!)

Miguel Gimenez

There is a ticket (676) for this issue and it includes a possible patch, but it is still open. I think it should be fixed before next release.

BlueHazzard

I can not reproduce this...
What libraries are needed to trigger this?
What compiler? How is the configuration?

sodev

AFAIK auto linking is not possible with GCC but only MSVC and the change is that recent versions do require uxtheme while older ones could work without.

To suffer from this problem you need GCC, Windows, a recent wxWidgets and a project that doesnt link uxtheme :D

BlueHazzard

QuoteTo suffer from this problem you need GCC, Windows, a recent wxWidgets and a project that doesnt link uxtheme :D
All here:
wxWidgets 3.1.2 gcc8 monolithic or not, shared or static, tried all configurations but i do not get this linker error... Windows 7... Does this only happen on windows 10?

Miguel Gimenez

It happens from wx3.1.0. Library liboleacc is also needed for the wizard-generated wxWidgets project.

https://github.com/wxWidgets/wxWidgets/blob/master/docs/changes.txt

Quote
wxMSW now requires linking with uxtheme.lib, shlwapi.lib and version.lib.
  This is done automatically in most cases, but if you use a static build of
  the library with a non-MSVC compiler such as MinGW and do not use wx-config,
  then you will need to add these libraries to your make or project files
yourself.

BlueHazzard

Ok, can now reproduce.

i have committed the patch from the ticket in version [r11560]

thank you all for your help!