In this tutorial, we will see how to build wxWidgets on a windows machine from source using Visual Studio.
For this build, I will be using Visual Studio 19. You may use other versions as well.
Download the Source Code
Go to wxWdigets Site and download the Latest Development Release as source code. I will use wxWidgets version 3.2.4 for this tutorial.
UnZip the source code files in a directory where you wish to install the SDK
My personal preference is at “C:\dev\SDK\wx324\“. For convenience, I will refer to this directory as $(WXDIR)
Note: I named the folder wx324 because I am using version 3.2.4 for different versions the name should correspond to the version number.
The source code comes with many Visual studio solution files. Go to “$(WXDIR)\build\msw“
Run the Visual Studio solution corresponding to your VS versions. If you are running Visual Studio 16 or later, choose “wx_vc16.sln“. Accept the security warning message boxes.
You should see the many solutions in the Solution Explorer.
![](https://technotes.blog/wp-content/uploads/2021/11/vs_wx_vc_16-1024x594.png)
Build wxWidgets
In Visual Studio go to Build->Batch Build
![](https://technotes.blog/wp-content/uploads/2021/11/batch-build-1.png)
Select All and then Hit Build
Make a cup of coffee and wait for the build to finish.
When the build is over you should see the following message:
![](https://technotes.blog/wp-content/uploads/2021/11/Screenshot-2021-11-08-152302.png)
You can find the compiled binaries at “$(WXDIR)\lib“
![](https://technotes.blog/wp-content/uploads/2021/11/Screenshot-2021-11-08-152423.png)
Create an App
First set an environment WXDIR
open System Properties->Environment Variable
![](https://technotes.blog/wp-content/uploads/2022/05/masterwork_pics.png)
Add a new variable called WXDIR.
NOTE: do not add a trailing slash “\”
![](https://technotes.blog/wp-content/uploads/2022/05/masterwork_pic3.png)
Open a new Project in Visual Studio
Open the project properties -> C/C++ -> General
![](https://technotes.blog/wp-content/uploads/2023/06/build_properties-1024x448.png)
also select “Not Using Precompiled Headers”
![](https://technotes.blog/wp-content/uploads/2023/06/build_properties_2-1024x448.png)