A short guide on how to build wxWidgets (the cross-platform GUI toolkit) from source (the recommended way), on Windows, by using CMake and Visual Studio.
-
Download the source code for the latest stable release
(by the way: For version 3.2.8 the ZIP file is ~40 MiB in size, while the 7z file is only ~22 MiB). -
Extract the downloaded archive file (for example to
C:\temp\wxWidgets). -
Configure (prepare) the buildsystem.
And define the installation destination directory, for later (wxWidgets can’t handle cmake –install yet).C:\temp\wxWidgets> cmake -DCMAKE_INSTALL_PREFIX=C:\install\to\wxWidgets\3.2.8 -S . -B .\_build -G "Visual Studio 17 2022" -A x64 -
Trigger the build process; at the end, the built artifacts will be installed to the previously defined destination path:
C:\temp\wxWidgets> cmake --build .\_build --target install
Done!
Further Reading
- wxwidgets.org: Installing wxWidgets for Windows | Building applications using wxWidgets (a general guide, but with more details)
- wxwidgets.org: CMake Overview
And for writing programs based on wxWidgets, I’ve recently discovered an interesting page (but not yet read fully):
- zetcode.com: wxWidgets tutorial
Film & Television (57)
How To (70)
Journal (18)
Miscellaneous (4)
News & Announcements (21)
On Software (12)
Projects (26)