wxWidgets is a cross-platform GUI library, that is also available for Windows. You can get started with using wxWidgets in a few steps:
- Download and install the Windows installer for the current stable release of wxWidgets from its download page. It installs the source and build files in
C:
. For example, inC:\wxWidgets-3.0.2\
- wxWidgets needs to be built before it can be used with your application. Go to
C:\wxWidgets-3.0.2\build\msw
and open the.sln
file that matches the Visual Studio version you intend to use for your application. For example, I openwx_vc10.sln
using Visual Studio 2012. - Choose one of the build types:
Debug
,Release
,DLL Debug
orDLL Release
and build the solution. The resulting.lib
files are placed inC:\wxWidgets-3.0.2\lib\vc_lib
- Create a new Visual Studio solution for your C++ application. Remember that it has to be
Win32 Project
, not aWin32 Console Project
. The difference is that themain
function is defined inside wxWidgets and does not need to be defined in your application code. - Add a
.cpp
file to your solution and copy the Hello World code into it. - Add
C:\wxWidgets-3.0.2\include
andC:\wxWidgets-3.0.2\include\msvc
as additional include directories to the solution. - Add
C:\wxWidgets-3.0.2\lib\vc_lib
as additional library directory to the solution. - Build the solution and run it to see an empty wxWidgets window.
Leave a comment