Search code examples
c++wxwidgetsvcpkg

File wx/wx.h does not exist


I've been trying for a while now to compile and use wxwidgets for a c++ project, but every time I think I get close, the same error occurs. File wx/wx.h does not exist. I've tried building wxwidgets with cygwin and VS2019, just downloading the binaries, and finally(what I've most recently tried), downloading the library using the vcpkg package manager. I made an environment variable to the include folder within wxwidgets(C:\vcpkg\packages\wxwidgets_x86-windows\include), and I included wx.h by typing

#ifndef WX_PRECOMP
    #include "wx\wx.h"
#endif

For clarification, I'm on windows 10 and I'm using clang++. Any help would be greatly appreciated, since I've had this problem for a while now and I couldn't find any answers.


Solution

  • You can build or get and use wxWidgets in many different ways, all of which work, but you can't mix different ways together and expect them to work.

    If you want to use vcpkg, you should follow the instructions here and you can read this post for more details.