How do I open #include<file.h> Follow Answered Chris Created February 16, 2022 19:48 How do I open the #include<file.h> that my cursor is on? In VSCode I can just "Go to definition" [F12]. What is it in CLiion?
Go to Definition should work in CLion in this case too. The shortcut depends on the keymap you use, please find it here https://www.jetbrains.com/help/clion/navigating-through-the-source-code.html#go_to_implementation.
It's not working for me.
I have my cursor on the #include<file.h> line and none of the options does anything. I've even tried it with the file open in another tab and nothing happens.
The project has the include file in it. I just want to open the header file under the cursor, a basic action.
On what build system is your project based?
Please create a default "Hello, World!" project (`File | New Project` > `C++ Executable` > `Create`), put cursor on iostream, right-click and choose Go To > Definition. Does it work?
It's a very large project, header files and source files are in different directory structures.
The Project is able to list all the files and directories. It links to the Git repository without any issue.
The test project worked.
You didn't answer my question. On what build system is your project based? CMake? Makefile? Some other?