CLion fails to find header files in path
已完成
I have a project with this structure:
root
|-- src
|-- phys
|-- common
|-- common.hpp
|-- ...
|-- ...
|-- ...
|-- tests
|-- client.cpp
|-- ...
client.cpp has:
#include <set>
#include "phys/common/common.hpp"
to which CLion emits errors:
'set' file not found
'phys/common/common.hpp' file not found
Regarding set, I also have "#include <set>" inside files in src, e.g., src/phys/common/common.hpp, where CLion detects it well and allows autocompletion, etc.
Regarding the second error ('phys/common/common.hpp' file not found), here's what puzzles me: In client.cpp I use classes declared in common.hpp, and CLion doesn't detect them but suggests fixes in the context actions in the vain of:
"Import class Foo from ../src/phys/common/common.hpp ?"
needless to say the project compiles well.
What am I doing wrong?
CMakeLists.txt has:
include_directories(src tests utils ...)
请先登录再写评论。
Hello!
Is client.cpp included into the project in CMakeLists.txt?
yes, this is from CMakeLists.txt:
(and client.cpp is in tests)
ah, I think I found the problem, there was a line in CmakeLists:
I'm glad you solved the issue!