1

I want to setup wxWidgets 3.2.1 in Code::Blocks 20.03, but with no success.

Here are the steps I took so far:

  1. Installed GCC 12.2.0 MinGW-W64
  2. Installed Code::Blocks 20.03 mingw setup
  3. Installed wxWidgets 3.2.1 using the Windows Installer
  4. Created a wxWidgets project in Code::Blocks: File > New > Project > wxWidgets Project
  5. Selected wxWidgets 3.1.x (since there is no entry for wxWidgets 3.2.x)
  6. Selected project and author information, "Preferred GUI Builder" and "Application Type"
  7. In the wxWidgets' location I enterd C:\wxWidgets-3.2.1 (where it's currently installed)
  8. Checked both Create "Debug" configuration and Create "Release" configuration
  9. Checked all the checkboxes in "wxWidgets Library Settings":
    • Use wxWidgets DLL
    • wxWidgets is built as a monolithic library
    • Enable unicode

When I proceed, I get the following two warnings:

A matching Debug configuration cannot be found in the wxWidgets directory you specified.
This means that Debug targets of your project will not be built.

Are you sure you want to continue with these settings?

A matching Release configuration cannot be found in the wxWidgets directory you specified.
This means that Release targets of your project will not be built.

Are you sure you want to continue with these settings?

If I continue and try to compile my project, I get 3 of the following error:

C:\wxWidgets-3.2.1\include\wx\platform.h 159 fatal error: wx/setup.h: No such file or directory

I headed to C:\wxWidgets-3.2.1\include\wx and found that setup.h is missing: it's actually located in C:\wxWidgets-3.2.1\include\wx\msw (one folder deeper).

Any ideas on how to correctly setup wxWidgets to work with Code::Blocks?

Zakk
  • 123
  • 8

1 Answers1

1

Actually, using the Windows Installer only installed the source code. I had to build it myself:

cd /D C:\wxWidgets-3.2.1\build\msw

And then

mingw32-make -f makefile.gcc BUILD=release SHARED=1 MONOLITHIC=1 UNICODE=1 CXXFLAGS=-fno-keep-inline-dllexport 2>log.txt

After that, I followed the same steps above starting from step 4. The project is created without problems.

Next, since there's no entry for wxWidgets 3.2.x in Code::BLocks 20.03 (step 5 above), I had to change libwxmsw31u.a to libwxmsw32u.a under:

  • Project > Build options > Debug > Linker settings
  • Project > Build options > Release > Linker settings

Compiled and run the project, and it did work.

Setting up wxWidgets with Code::Blocks in Windows was of great help.

Zakk
  • 123
  • 8