I have a project that links multiple static libs (e.g. libModule.a). When I try to navigate to classes inside the Module lib, Clion takes me only to the header declaration and stops navigation there. I want to be able to dig into the definition of functions inside the Module lib.
I had the same problem and here is what I did. In Clion I enabled debug logging by entering #com.jetbrains.cidr.execution.debugger into Help | Debug Log Settings, reproduced the problem and then looked at the idea.log created (Help | Show Log). In the log it showed the full path to the source it could not find. The source on my box was not in the same place, so by creating a symbolic link in the appropriate directory I was able to have Clion find it by the full path it was looking for.
For CMake projects just add path to your lib source code in CMakeLists.txt via:
include_directories(${SOME_LIB_SRC_DIRS})
or direct path
include_directories("/home/username/lib_src/")
Then on function name ctrl+click CLion will show you function definition first and then if you ctrl+click again -- will show you declaration in a header file (also you can use hotkeys and mouse right-click menu for this).
© 2022 - 2024 — McMap. All rights reserved.
libModule.a
? – ClippardCMakeLists.txt
that describe you project and these libraries (how build them), without this clion have no idea about where get sources of libraries – Clippard