A short guide on how to build wxWidgets (the cross-platform GUI toolkit) from source1, 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-3.2.8). -
Configure (prepare) the buildsystem.
And define the installation destination directory, for later (wxWidgets can’t handle cmake –install yet).
Note that the following should be on one line, it’s only split here for readability reasons:C:\temp\wxWidgets-3.2.8> 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-3.2.8> cmake --build .\_build --target install
Done!
Further Reading
- A generic guide for wxWidgets, with more details: Installing wxWidgets for Windows | Building applications using wxWidgets
- A CMake-specific overview for wxWidgets
-
That is the recommended way:
↩︎When installing wxWidgets on Windows or macOS, we always recommend building the library from source yourself,
Film & Television (56)
How To (68)
Journal (18)
Miscellaneous (4)
News & Announcements (21)
On Software (12)
Projects (26)