doublemax wrote: ↑
Sun Dec 29, 2019 1:41 pm
Building an empty VS studio project with wxWidgets from scratch is not an easy task. A lot of paths, libraries, preprocessor symbols etc. need to be set correctly.
I dare to disagree, it is actually very simple and should be done under five minutes.
The following assumes you have set the WXWIN
environment variable correctly, so its value is something like c:\wxwidgets
. Obviously, it also expects you built the requested configurations of wxWidgets.
For example, a simple guide below shows a wxWidgets-related MSVS project settings one needs to add for a DLL Debug configuration of a wxWidgets app. The titles in bold and italics in sections 1-4 correspond to the Configuration Properties of a project. Section 5 also describes modifications of the project needed for example for a Release or Static build.
Make sure Character Set
is set to "Use Unicode Character Set".
2.1 General/Additional Include Directories:
Code: Select all
2.2 Preprocessor/Preprocessor Definitions:
When you are using a MSVC-specific include (see step 2.1), all necessary libraries are linked automatically and you do not need to list their names, you just need to tell the linker where they are.
3.1 General/Additional Library Directories:
The resources options may become available only once you add an .rc file to your project. You should have one, if only to add the application icon.
4.1 General/Additional Include Directories:
5 Additional tips
5.1 Making the wxWidgets DLLs available
If you use the DLL build, you must make the correct wxWidgets DLLs available to your program. Either copy them to the directory where the executable resides or just for running the app from the MSVS in Debugging
set the Environment
5.2 Settings for for the Release configuration
In the preprocessor definitions (see step 2.2) replace
5.3 Static build
If you do not want a DLL build, remove this preprocessor definition (see step 2.2)
and change the linker's library directory (see step 3.1) to
5.4 DPI Awareness
Last but not least, if your application is DPI-aware (it better be in 2020), you should at least set its DPI Awareness
in Manifest Tool/Input and Output
to "High DPI Aware". But it may be better to include a proper application manifest, with Windows version compatibilities listed and having PerMonitorV2 awareness there. However, PMv2 DPI awareness support is not that good yet in wxWidgets, see e.g. here
BTW, I expect you read this official guide for setting up wxWidgets apps on MSW