Author Topic: Using CB with wxWidgets 3.1.2 - Anyone having problems?  (Read 4031 times)

Offline blinkinhek

  • Multiple posting newcomer
  • *
  • Posts: 17
Using CB with wxWidgets 3.1.2 - Anyone having problems?
« on: January 29, 2019, 05:40:22 pm »
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:
Code
-------------- 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.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

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1553
Re: Using CB with wxWidgets 3.1.2 - Anyone having problems?
« Reply #1 on: January 29, 2019, 05:55:56 pm »
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.

Offline blinkinhek

  • Multiple posting newcomer
  • *
  • Posts: 17
Re: Using CB with wxWidgets 3.1.2 - Anyone having problems?
« Reply #2 on: January 29, 2019, 06:09:28 pm »
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!)

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1553
Re: Using CB with wxWidgets 3.1.2 - Anyone having problems?
« Reply #3 on: January 29, 2019, 06:35:54 pm »
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.

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: Using CB with wxWidgets 3.1.2 - Anyone having problems?
« Reply #4 on: January 30, 2019, 12:44:21 am »
I can not reproduce this...
What libraries are needed to trigger this?
What compiler? How is the configuration?

Offline sodev

  • Regular
  • ***
  • Posts: 497
Re: Using CB with wxWidgets 3.1.2 - Anyone having problems?
« Reply #5 on: January 30, 2019, 10:04:49 am »
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

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: Using CB with wxWidgets 3.1.2 - Anyone having problems?
« Reply #6 on: January 30, 2019, 10:30:19 am »
Quote
To 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?

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1553
Re: Using CB with wxWidgets 3.1.2 - Anyone having problems?
« Reply #7 on: January 30, 2019, 11:55:07 am »
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.

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: Using CB with wxWidgets 3.1.2 - Anyone having problems?
« Reply #8 on: January 30, 2019, 11:54:55 pm »
Ok, can now reproduce.

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

thank you all for your help!