I'm using sublime text with the sublime linter plugin especially with clang.
When I open a folder, it use the root of the folder as a header location, so if I have
src
├── World
│ ├── Chunk.cpp
│ ├── Chunk.hpp
│ ├── World.cpp
│ └── World.hpp
└── main.cpp
In World.cpp I need to include "World/World.hpp".
But if in World.hpp I include Chunk.hpp the same way ("World/Chunk.hpp"), I get an error but in World.hpp I have no error. Error are only in file I include that include other file.
I had the same issue. You need to tell clang where to look for the files, i.e. which directories you want to include. Go
Preferences-->Package Settings-->SublimeLinter-->Settingsand add a new section forclang++:In your case the two include directories will actually point to the same path but in general, the first version is to include your source directory (e.g. you have a unit test from a different folder open which accesses code from you
srcdirectory) and the second line includes the location of your current file.If you need different directories, find some more variables you can use here.