CLion indexer does not resolve some includes in the project directory

Viewed 24929

I have a CLion C++ project that has the following structure:

    project
       ---->my_includes
       |   ----> my_own.hpp
       ---->source
           ----> my_app
               ----> my_src.cpp

The first line of my_src.cpp is

#include "my_includes/my_own.hpp"

I use an external build system that requires this inclusion format. The problem is if I use a function in my source file defined in the included header, CLion says "Cannot find my_own.hpp" if I try to hover over the inclusion.

I tried marking the include directory as containing Project Source or Headers but this didn't fix it. Any ideas?

3 Answers

And for MakeFile + gcc (g++) projects, you can add the flag -I /Dir/To/Your/Project.

If CLion still shows errors with #include after recompiling the make file, delete the .idea folder and restart CLion.

Related