I want to include the wx library in my c++ program but following the given default instruction don't include the library in Visual Studio 2019
I tried (quoting from the instruction install.md
):
Open a "Visual Studio Command Prompt"
Change directory to \%WXWIN\%\build\msw and type
> nmake /f makefile.vc
Also i tried to include the file wxwidgets.props
as explained in the given instruction
If i try to do
#include <wx/frame.h>
is marked as mistake ("impossible to open "wx/frame.h" of origin file)
Note: for the creation of the GUI I'm also using wxFormBuilder
After some time wondering around forum, I've found a video on Youtube explaining how to include wx in your Visual Studio project, so i decided to post the answer to my question helping how will need this help in the future like i needed.
wxWidgets-X.X.X\build\msw
and open with Visual Studio wx_vc15.sln
(or more recent if available)Debug
, DebugDLL
, Relase
and RelaseDLL
.Project
menu and tap Project propriety
All configuration
, go to section C/C++ and in Additional Include directorys
add \wxWidgets-X.X.X\include
Processor definition
the string WXUSINGDLL
Linker
and on Additional library Directory
add \wxWidgets-X.X.X\lib\vc_dll
C\C++
add another additional include directory that is wxWidgets-X.X.X\lib\vc_dll\mswud
wxWidgets-X.X.X\lib\vc_dll\mswu
This will include the wx library in your code
Here the link for the video https://www.youtube.com/watch?v=EI2taYkErRg if you need more detail or if you need visually the explaination.
NOTE: in the install.md
is missing the part of including the library in the project in this way, it mention only to compile the Debug version not well explaining why or what to do next.