CLion - Cannot reach header file from cpp file

已回答

I have divided up my files in headers and cpp files, in the two folders "headers" and "src".

So when I want to access the header file from my cpp file I can't just write #include "someHeader.h", I need to write #include "../headers/someHeader.h". That's because they are not in the same folder.

I know I have to configure something in the CMakeList.txt file but I don't know what exactly.

Thanks for answers.

1

Hi.

Please try using include_directories command.

0
Avatar
Permanently deleted user

I do not really understand the documentation for include_directories. I already use this command to include frameworks. Could you give an example together with my given directories? Thank you.

0

请先登录再写评论。