classes are not indexed after importing existing sources

Hello

I've imported a large legacy codebase after trying clion with a small pilot project.
The cmake file is generated and presumably all files are included.
But when I try to use alt+enter on any variable all I get is <unnamed> <unknown>.
Moreover nothing is listed in find classes.

The only error message I get is "cannot determine link language".

How can I make this work? The code is quite old and has a custom build system based on gcc (+ a homebrewn OS API, which is not included in the project neither linked as a library)


The EAp I use is 5th build 140.1740.3 on linux

3 comments
Comment actions Permalink

Hi David.

Could you please specify if you could build your project?
Which errors do you see when you try to build your project?

The main idea is if your project is big and consists of external libraries, has many dependencies between headers and sources, you can’t import it to CLion so simply.
Our import only makes CMakeLists.txt but all complicated logic should be implemented via CMake parameters.

0
Comment actions Permalink

Hello Anna,

it's unfortunate to hear.
It won't be possible to build the project with cmake, and without writing a custom plugin, I'm sure it won't even be possbile to build it at all even if I add the homemade OS dependencies.
The only reason I wanted to use clion is to get the editor features (refactoring, smart autocomplete), just as I could access these features without any extra effort (and building) from QtCreator and Eclipse CDT, or any other IDEs I've seen.
So if I understand you correctly, this could be considered a feature request as it is not implemented, ie. to index the code w/o building.

0
Comment actions Permalink

Hello David.

CLion is an intelligent IDE for C and C++. It means that it provides many features like smart completion, one-click navigation, code analysis and more to make developers more productive.
To support these features CLion uses a concept of a project and relies on CMake as a build system for it.
All the includes paths, variables and more is taken from CMake files and are used by CLion to understand your project better and to resolve your code correctly.

So while you can auto-import existing sources, any external or non-trivial dependencies wouldn't be resolved and used while indexing, also useless (for you) CMake files would be produced in your source dir.

0

Please sign in to leave a comment.