Eclipse CDT Indexing Doesn't Work To Find Project Ads

I installed the Eclipse plugin and CDT on a recently installed Ubuntu. Indexing is set to "Quick Indexing", which is recommended ("Full Indexing" seems to have a slight difference).

In many places, if I press 'F3' ('show declaration') on any class name or include a file name, the cursor remains fixed and this does not result in a declaration. However, it works for standard files and characters like stdio.h , std::vector , etc.

For example, I have 2 files,

 /home/myself/Workspace/Project/X/Y/include/file.h /home/myself/Workspace/Project/X/src/file.cpp 

I do not see any declaration of any class or variables displayed in file.cpp that are inside file.h Even by pressing 'F3' on #include"file.h" , I cannot go to file.h

An Eclipse workspace is created in the Workspace folder, a C ++ project is created in the Project folder. To save the include path, I followed this procedure in Eclipse:

Project โ†’ Properties โ†’ C / C ++ General โ†’ Outlines and Symbols โ†’ Library and Paths โ†’ Add '/Project/X/Y/include/file.h " (uses' Workspace' and 'FileSystem' both)

But still no luck. I did enough search on the Internet and so, but did not find anything useful. Please note that I use eclipse only to view the code, not to create the code at the moment.

+6
source share
1 answer

Ok, earned it. In fact, all of the included paths that I included in Paths and Symbols are redundant, and they do not matter, since everything under the Workspace/Project will be indexed.

The solution is very strange and is related to scalability , which I learned from this link . In Eclipse, go to

Window โ†’ Settings โ†’ C / C ++ โ†’ Editor โ†’ Scalability โ†’ "Enable zoom mode when ..."

Set a huge number, for example 500000 , and click "OK." The problem is solved! For my case, the actual setpoint was 5000 , and the source file I saw was 16k+ .

+14
source

Source: https://habr.com/ru/post/907304/


All Articles