Not able to configure wxwidgets in Visual Studio 2017.
Followed these steps.
wx_vc15.sln
from build
->msw
in Visual Studio 2017.Debub
, DLL Debug
, DLL Release
, Relese
successfully with Platform x86
.In Microsoft Visual Studio 17 V15.9.20
, created an empty project. Added a simple wxWidgets program.
In project properties
made the below changes
- In All Configurations
with Platform Win32
, Set the Configuration Properties
-> Character Set
to Use Unicode Character Set
C/C++
-> Additional Include Directories
-> $(WXWIN)\include\msvc;$(WXWIN)\include;
C/C++
-> Preprocessor
-> Preprocessor Defenitions
-> __WXMSW__;WXUSINGDLL;_DEBUG
Linker
-> Additional Library Directories
-> $(WXWIN)\lib\vc_dll
Made these changes in Environment Variables
User variables
WXWIN
and set its value to C:\Users\varun\Desktop\workspace\wxWidgets-3.1.3
.C:\Users\varun\Desktop\workspace\wxWidgets-3.1.3\lib\vc_dll
.In project properties Release
Configurations, made these changes
C/C++
-> Preprocessor
-> Preprocessor Defenitions
-> __WXMSW__;WXUSINGDLL;NDEBUG;
There is no code error but Linker Tools Error
Error (active) E1097 unknown attribute "no_init_all" WxWidgets_Application_5 C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\winnt.h
Error LNK2019 unresolved external symbol _main referenced in function "int __cdecl invoke_main(void)" (?invoke_main@@YAHXZ) WxWidgets_Application_3 C:\Users\varun\Desktop\workspace\visual_studio_projects_2017\WxWidgets_Application_3\WxWidgets_Application_3\MSVCRTD.lib(exe_main.obj)
Error LNK1120 1 unresolved externals WxWidgets_Application_3 C:\Users\varun\Desktop\workspace\visual_studio_projects_2017\WxWidgets_Application_3\Debug\WxWidgets_Application_3.exe
What could have gone wrong?
The first error you show is not an error at all but just some IntelliSense noise, see this bug report. The real error is not being able to find _main
which seems to indicate that you're building a console application (see Properties\Linker\System\SubSystem
option), so it should be fixed by just making it a Windows application instead.
Also, while I don't see anything really wrong with your setup, I would still recommend using the official instructions instead. Notably in your case it should be as simple as:
If you use MSVS 2010 or later IDE for building your project, simply add
wxwidgets.props
property sheet to (all) your project(s) using wxWidgets. You don't need to do anything else.