What is wxWidgets
wxWidgets is a C++ GUI library that works on platforms such as Windows, Mac, Linux, Android, and iOS.
Installing wxWidgets
- Open https://www.wxwidgets.org/downloads/ and download the
Windows Installer. - Run
wxMSW-3.2.2.1-Setup.exeto install. - Open “C:\wxWidgets-3.2.2.1\build\msw\wx_vc17.sln” from the installed folder.
- After opening
wx_vc17.sln, selectBuild>Batch Build. - Click the
Select Allbutton, and then click the Rebuild button. - Once the build is finished, temporarily close Visual Studio.
Creating a Sample Project
- Open Visual Studio.
- Select
File>New>Project. - Select
Windows Desktop Application(tabs areC++,Windows,Desktop). - Enter
wxWidgetsSamplefor theProject Name. - Click
Create. - Right-click
wxWidgetsSampleand selectProperties. - Under
Configuration Properties>C/C++>Additional Include Directories, addC:\wxWidgets-3.2.2.1\includeandC:\wxWidgets-3.2.2.1\include\msvc. - Under
Configuration Properties>Linker>Additional Library Directories, addC:\wxWidgets-3.2.2.1\lib\vc_x64_lib. - Open
wxWidgetsSample.cppand replace it with the code below.
| |
- If you build and run it, a window like the one below will open.

References
The sample project is provided below. wxWidgetsSample
That’s all.
