PB’s Guide to Starting with wxWidgets on Microsoft Windows with MinGW and Code::Blocks

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
PB
Part Of The Furniture
Part Of The Furniture
Posts: 2429
Joined: Sun Jan 03, 2010 5:45 pm

PB’s Guide to Starting with wxWidgets on Microsoft Windows with MinGW and Code::Blocks

Post by PB » Thu Jun 04, 2020 7:11 pm

I am aware that there already are several recent guides to using wxWidgets with MinGW and Code::Blocks. However, I wrote most of mine almost two years ago, but did not find time to finish it. But now I did and updated it for the latest versions of wxWidgets, MinGW and Code::Blocks.

My guide hopes to assist the readers with decisions regarding which wxWidgets version and configuration to use and show how to build wxWidgets using MinGW with various parameters affecting the resulting build. It also describes in detail setting-up a wxWidgets project in popular IDE Code::Blocks. Its page count may seem off-putting to some, but there is not that much text, most of it is pictures and whitespace.

I wrote the guide in Microsoft Word, using complex formatting and it seems that converting all of it to MediaWiki or HTML format is quite difficult, so at least for the time being, it is provided only in the PDF format.

The guide is available at https://github.com/PBfordev/wxpbguide as wxPBGuide.pdf. I recommend using a decent PDF viewer instead of GitHub's built-in one, which lacks useful features such as displaying a navigable TOC or clicking on document's internal cross links.

Perhaps the guide helps someone, it should cover all necessary information, hopefully presented in a simple and understandable way.

Versions of software used in guide
wxWidgets: 3.1.3
MinGW: mingw-w64 i686-8.1.0-posix-sjlj-rt_v6-rev0
Code::Blocks: 20.03

Table of Contents
----------
1 Introduction
2 Basic wxWidgets Information
2.1 wxWidgets Versions
2.2 Shared vs Static Linking
2.3 Multilib vs Monolithic Build
2.4 Debug and Release Configuration
2.5 32-bit vs 64-bit Build
2.6 To Build or Not to Build
3 Building wxWidgets with MinGW
3.1 Choosing MinGW Distribution
3.2 Installing mingw-w64
3.3 Downloading wxWidgets Sources
3.4 Adding System Environment Variable WXWIN
3.5 The Build
3.5.1 Starting Simple
3.5.2 Improving Build Commands
3.5.3 Viewing Build Results
3.5.4 Using the Minimal Sample to Test the Build
3.5.5 Cleaning the Build
3.5.6 Making wxWidgets Build Faster
3.5.7 Building wxWidgets Statically
3.5.8 More Build Options
4 Setting Up wxWidgets Project with Code::Blocks and MinGW
4.1 Installing Code::Blocks
4.2 Configuring the Compiler
4.3 Creating Global Variable wx
4.4 Creating a wxWidgets Project with Project Wizard
4.4.1 Selecting wxWidgets Project Template
4.4.2 Wizard Page 1: Welcome
4.4.3 Wizard Page 2: wxWidgets Version
4.4.4 Wizard Page 3: Project Title and Paths
4.4.5 Wizard Page 4: Project Author
4.4.6 Wizard Page 5: GUI Builder and Application Type
4.4.7 Wizard Page 6: wxWidgets Location
4.4.8 Wizard Page 7: Compiler and Debug/Release Configurations
4.4.9 Wizard Page 8: Various Configuration Options
4.4.10 Wizard Page 9: Advanced Options
4.4.11 Wizard Page 10: Additional Libraries
4.5 Adjusting Project Settings
4.5.1 Setting C++ Standard Used in the Project
4.5.2 Setting Preprocessor Define NDEBUG for the Release Build Target
4.5.3 Setting Other Project Options
4.6 Finally Finished!
4.7 Extra Reading: wxWidgets Code::Blocks Project Under the Hood
4.7.1 Compiler Include Folders
4.7.2 Preprocessor Defines
4.7.3 Linker Settings
4.7.4 Using Static Instead of Shared wxWidgets Build

Post Reply