Search code examples
c++linuxwxwidgets

Upgraded to unofficial wxWidgets 3.0 = > Fatal error wx/wx.h: No such file or directory


When I compile my project:

----------------------------------------------------------------------
wxFlasher configuration :
+ DEBUG = 0
+ UNICODE = 1
+ STATIC = 0
+ WX_VERSION = 3.0.2
+ SRC_DIR = /home/barnaud/dev/wxFlasher/wxFlasher/src
+ BUILD_DIR_BASE = /home/barnaud/dev/wxFlasher/wxFlasher/build_gcc/releaseu
+ OUT_DIR = /home/barnaud/dev/wxFlasher/wxFlasher/out_gcc/releaseu
+ GCC_PATH = /usr/bin/gcc
+ GCC_VERSION = gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4
----------------------------------------------------------------------
Generating Main/Headers.h.gch...
/home/barnaud/dev/wxFlasher/wxFlasher/src/Main/Headers.h:18:23: fatal error: wx/wxprec.h: Aucun fichier ou dossier de ce type
 #include <wx/wxprec.h>

I well installed the libraries:

$ wx-config --libs
-L/usr/lib/x86_64-linux-gnu -pthread   -lwx_gtk2u_unofficial_xrc-3.0 -lwx_gtk2u_unofficial_webview-3.0 -lwx_gtk2u_unofficial_html-3.0 -lwx_gtk2u_unofficial_qa-3.0 -lwx_gtk2u_unofficial_adv-3.0 -lwx_gtk2u_unofficial_core-3.0 -lwx_baseu_unofficial_xml-3.0 -lwx_baseu_unofficial_net-3.0 -lwx_baseu_unofficial-3.0 

cxxflags output :

wx-config --cxxflags
-I/usr/lib/x86_64-linux-gnu/wx/include/gtk2-unicode-3.0-unofficial -I/usr/include/wx-3.0-unofficial -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -pthread

Now, how can I include the library in my project?


Solution

  • Look at the compiler command line (by running make -n if necessary, i.e. if your makefile hides it by default) and check if it uses the correct flags from wx-config. If it does, also check that you ran make install after building wxWidgets so that the headers are indeed available in the directory appearing in wx-config --cxxflags output.