Search code examples
c++visual-studiowxwidgets

Problem with "setup.h" wxwidget - "cannot open file"


Hello i build 32 and 64 bit version wxwidget (Batch Build and select all) from source code without any problems. Then add path to the system variables as named "WXWIN" with C:\wxwidget (there is wxwidget source)

In visual studio 2019 in solution i add these path's:

  • C/C++ -> Additional Include Directories ->

$(WXWIN)\include $(WXWIN)\include\msvc

  • Linker -> Additional Library Directories ->

$(WXWIN)\lib\vc_lib $(WXWIN)\lib\vc_lib\mswud

But i got error in visual:

Severity Code Description Project Path File Line Suppression State Error (active) E1696 cannot open source file "../../../lib/vc_lib/mswd/wx/setup.h" guiwxwidget C:\wxwidgets\include\wx C:\wxwidgets\include\wx\setup.h 140

And i dont know whats wrong with it.

I try also recompile 4x wxwidget source without any progress.


Solution

  • Your project is not configured to use Unicode, hence it tries using non-Unicode build of wxWidgets (note the missing u in mswd/wx/setup.h) which is not available. You should ensure that the "Character Set" option in the "Advanced" section of your project properties is set to "Use Unicode Character Set".

    The strange thing is that this should be the default, so it looks like you might have changed it intentionally. If you really did, you will need to build wxWidgets in (deprecated and soon to be removed) ANSI build mode, but it's much better to leave this option at its default value and use Unicode -- we're in 2021, after all, not 1991.