Page 1 of 1

Using codeblocks with wxWidgets 3.1

Posted: Tue May 31, 2016 9:27 am
by New Pagodi
As of now, the codeblocks wizard for wxWidgets projects does not support wxWidgets 3.1. This means that when you try to create a new wxWidgets project using 3.1, you’ll eventually get a warning that a matching debug/release configuration could not be found. This has come up in a few threads, so I thought it might be a good idea to have 1 thread to discuss this issue.

There are at least 2 possible fixes. First you can ignore the warning and then make a few changes manually to make the project work. Alternately I have tried to modify codeblocks’ wizard script to add support for 3.1. I’ll cover both of these in the next posts.

Re: Using codeblocks with wxWidgets 3.1

Posted: Tue May 31, 2016 9:30 am
by New Pagodi
Option 1: Manually Fix the Project Settings

If you just want to ignore the warnings, in order for the project to build successfully, you’ll need to change the names of the link libraries the project uses.
  • Select Project->Build options->linker settings
  • Then select the release or debug target
  • Under “link libraries”, change anything with a name like _wx_30u_ to _wx_31u_
So for example, for a GCC static, multib, debug target you would change libwxmsw30u_core.a to libwxmsw31u_core.a and libwxbase30u.a to libwxbase31u.a

For a visual c, shared, monolithic, release target you would change wxmsw30u.lib to wxmsw31u.lib.

In addition if you are using MinGW or TDM-GCC and a static build of wxWidgets, you will need to add libshlwapi.a and libversion.a to the projects link libraries.

Re: Using codeblocks with wxWidgets 3.1

Posted: Tue May 31, 2016 9:36 am
by New Pagodi
Option 2: Modifying the wizard script

The script tries to add 3.1 to the wizard. I have only tested it on windows and only with TDM-GCC and Visual C++. With TDM-GCC, I have tested it with multlib static release, multlib static debug, multlib shared release, and multlib shared debug. With Visual C++, I have tested it with monolothic static release, monolothic shared release, monolothic shared debug.

To use it,
  • open the new project dialog (File->New->Project…)
  • right click on the wxWidgets icon
  • select “Edit this script”
  • a new tab will open with the contents of the default wizard script.
  • Replace the contents of that tab with the script below
  • save the file
replace.png
replace.png (11.18 KiB) Viewed 22784 times
Important:
When the codeblocks developers add support for 3.1, their wizard will be better than mine. So the next time you update codeblocks, be sure to remove my script:
  • open the new project dialog (File->New->Project…)
  • right click on the wxWidgets icon
  • select “Discard modifications of this script”
  • select yes in the confirmation dialog box.
wxWidgets31.zip
(9.01 KiB) Downloaded 1332 times

Re: Using codeblocks with wxWidgets 3.1

Posted: Tue Jun 28, 2016 1:28 am
by combo
Very useful, good~~

Re: Using codeblocks with wxWidgets 3.1

Posted: Tue Nov 29, 2016 4:54 am
by siXEs&niNeS
grabbed the script just in case, cheers,
I simply renamed my libs to 30u.a from 31u.a
Have not had any issues yet