A basic project for building wxWidgets apps.
Note: This project uses CMake, which must be installed and be on your Path for this setup to work.
- Clone this repo.
- Make a
build
directory in the main directory$ mkdir build
- Move into the
build
directory and run CMake:$ cmake ..
- Once CMake has finished running (assuming there were no errors), a Makefile should have been generated. Run it:
$ make
- Once the build has succeeded, there should be an executable named
WxStarter
in thebuild
folder. Run it and you should see a basic wxWidgets window!./WxStarter
Visual Studio is recommended for Windows development (see setup guide below).
For MacOS, you can use Xcode (see instructions below), VSCode, CLion or any other C++ IDE. If you want to use VSCode, you can use the example config (c_cpp_properties.json
) as a guide for setting up include directories. Note that you will need to add any additional header and source files to the CMakeLists.txt file for Intellisense to work.
- Make a folder called
xcode_build
.$ mkdir xcode_build
- Move into the folder
$ cd xcode_build
- Run CMake with the Xcode generator:
$ cmake -G Xcode ..
- Open the
.xcodeproj
file in Xcode.
Note: This guide assumes you have a system environment variable called WXWIN which points at the wxWidgets root folder (the one which contains include
, lib
, samples
, src
etc. If this environment variable is named something different on your computer, adjust the following commands accordingly.
- Make sure you have installed Desktop Development with C++ for Visual Studio with the Visual Studio Installer.
- Double-click the
wxStarter.sln
file to open it in Visual Studio. - Right click on the wxStarter project in the Solution Explorer (not the solution but one level down from it) and select "Properties".
The following settings should be already enabled, but if not, here's how to set them up:
- Go to C/C++ an select 'General'. Make sure the Additional Include Directories include
$(WXWIN)\include
and$(WXWIN)\include\msvc
. - Go to Linker and select ''General'. Make sure that the SubSystem is set to
Windows (/SUBSYSTEM:WINDOWS)
. - Go to Linker -> 'General'.
- Select the 'Platform' dropdown at the top of the dialog and select 'Win32'. Add
$(WXWIN)\lib\vc_lib
to 'Additional Library Directories'. - Select 'x64' from the 'Platform' dropdown, and add
$(WXWIN)\lib\vc_x64_lib
to 'Additional Library Directories.
- Select the 'Platform' dropdown at the top of the dialog and select 'Win32'. Add
- Click 'Apply', then 'OK'.
- In the main Visual Studio window, select 'Release' and 'x64', then click the 'Local Windows Debugger' icon. The window should appear on the screen!