Using codeblocks with wxWidgets 3.1

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
New Pagodi
Super wx Problem Solver
Super wx Problem Solver
Posts: 466
Joined: Tue Jun 20, 2006 6:47 pm
Contact:

Using codeblocks with wxWidgets 3.1

Post 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.
New Pagodi
Super wx Problem Solver
Super wx Problem Solver
Posts: 466
Joined: Tue Jun 20, 2006 6:47 pm
Contact:

Re: Using codeblocks with wxWidgets 3.1

Post 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.
Last edited by New Pagodi on Tue May 31, 2016 9:38 am, edited 1 time in total.
New Pagodi
Super wx Problem Solver
Super wx Problem Solver
Posts: 466
Joined: Tue Jun 20, 2006 6:47 pm
Contact:

Re: Using codeblocks with wxWidgets 3.1

Post 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 19188 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 1291 times
Attachments
disc.png
disc.png (11.49 KiB) Viewed 19188 times
combo
In need of some credit
In need of some credit
Posts: 8
Joined: Sun Aug 26, 2012 10:09 pm

Re: Using codeblocks with wxWidgets 3.1

Post by combo »

Very useful, good~~
siXEs&niNeS
In need of some credit
In need of some credit
Posts: 3
Joined: Tue Nov 29, 2016 2:16 am

Re: Using codeblocks with wxWidgets 3.1

Post 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
Post Reply