The library it is not recognizing is WxWidgets

my ~/.vimrc File

execute pathogen#infect()
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*

let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
let g:syntastic_check_on_wq = 0

I import Wx like this

#include <wx/wx.h>
#include <wx/menu.h>
#include <wx/textctrl.h>

The Error is

gui.cpp|1 col 10 error| fatal error: wx/wx.h: No such file or directory 

I already included the Path of Wx like this

let g:syntastic_cpp_include_dirs =['/usr/local/lib']

And i can Compile it with out any Problems

  • Welcome to Vim :-) It would be good if you could be more explicitly about your symptoms. Could explain what is your input and what do you expect.? Maybe also what you already tried. Commented Jun 6, 2022 at 21:36
  • Is wx/wx.h actually at /usr/include/wx/wx.h or /usr/local/include/wx/wx.h? On my system at least it's in /usr/include/wx-3.0/wx/wx.h; I think most systems use a version subdirectory like that for WxWidgets (although the exact path may be slightly different on your system). So try adding /usr/include/wx-3.0 (or whatever the exact path is on your system) to g:syntastic_cpp_include_dirs. Commented Jun 7, 2022 at 9:57
  • Thx yes it where the wrong path i also have on the other path some wxWidgets stuff but now it works
    – Benn1x
    Commented Jun 7, 2022 at 14:39
  • @Benn1x can you post an answer?
    – D. Ben Knoble
    Commented Jun 8, 2022 at 18:16

1 Answer 1


My problem where that i had included the wrong path as @Martin Tournoij said the path where /usr/include/wx-3.x

The include in the .vimrc looks now like this

let g:syntastic_cpp_include_dirs =['/usr/local/lib',' /usr/include/wx-3.1','/usr/include/wx-3.0']

And this solved the use for me

Not the answer you're looking for? Browse other questions tagged or ask your own question.