indexer not working on *.cpp files [message #1844693] |
Wed, 22 September 2021 01:06  |
Eclipse User |
|
|
|
I am having trouble with the indexer in a couple of my CDT projects where it isn't able to resolve symbols/headers but only for .cpp files. The majority of the .cpp files only have one header inclusion and that is it's accompanying header. The parser is able to do just fine on the header file but fails to resolve anything on the cpp file.
This is only happening for a couple of my CDT projects and it only started happening recently so I'm guessing it's something to do on my end but am posting here in case anyone can help.
I've tried downloading older versions of CDT/eclipse, I've tried creating a new project directory and setting up the project from scratch several times but have had no success. As for all my projects I've added '-std=c++17' to the Properties --> C/C++ General --> Preprocessor Include Paths --> Providers which was an issue of mine in the distant past but I don't think that's the issue cause it's working for the header files (.hpp) and in the parse log file for the cpp file I find "__cplusplus=201703L".
The odd thing too is the unresolved headers paths can be found underneath the Include Search Path (option -I): section in the cpp parser file so I'm not sure why they can't be resolved.
I've attached the parser log files for both a cpp file and the hpp file it includes.
I've bashed my head against a wall for several hours on this so any suggestions for what else to look into would be greatly appreciated, thanks!
|
|
|
|
|
|
|
|
|
|
Re: indexer not working on *.cpp files [message #1847495 is a reply to message #1844813] |
Fri, 29 October 2021 00:40  |
Eclipse User |
|
|
|
I am suffering from the exact same issue. In my case the issue is more with header files. Index rebuilding solutions are totally useless. Indexer fails to pick up few of my own header files as well as some of system headers.
To troubleshoot the indexer I first generated the parse log file (sample attached ScrollWheel.log). On lines 11976 and 11977 you can see the indexer reporting unresolved files ParameterValue.h and VariableStepTable.h both of which are in my project and paths to both the files are known to the indexer (log file line number 60). I couldn't go any further than this for I don't know for what reason indexer is unable to resolve the header file even when it is in a known path.
The next step was to run eclipse in debug mode while adding options to get details on what the indexer is doing. I ran the following command in a terminal (Ubuntu).
./eclipse -debug .options
The option file is attached. Then I selected ScrollWheel.c and ScrollWheel.h in the project explorer and ran Index > Freshen All Files. Following is the output I get.
Indexer: start PDOMUpdateTask
Indexer: parsing /LinEmLibrary/library/Widgets/ParameterAdjustment/ScrollWheel.h
Indexer: adding file:/mnt/win_d/Projects/ADS/TV1/LIN/SW/LinEmLibrary/library/Widgets/ParameterAdjustment/ScrollWheel.h
Indexer: processed /LinEmLibrary/library/Widgets/ParameterAdjustment/ScrollWheel.h [97 ms]
Indexer: parsing /LinEmLibrary/library/Widgets/ParameterAdjustment/ScrollWheel.h
Indexer: adding file:/mnt/win_d/Projects/ADS/TV1/LIN/SW/LinEmLibrary/library/Widgets/ParameterAdjustment/ScrollWheel.h
Indexer: processed /LinEmLibrary/library/Widgets/ParameterAdjustment/ScrollWheel.h [47 ms]
Indexer: parsing /LinEmLibrary/library/Widgets/ParameterAdjustment/ScrollWheel.h
Indexer: adding file:/mnt/win_d/Projects/ADS/TV1/LIN/SW/LinEmLibrary/library/Widgets/ParameterAdjustment/ScrollWheel.h
Indexer: processed /LinEmLibrary/library/Widgets/ParameterAdjustment/ScrollWheel.h [95 ms]
Indexer: parsing /LinEmLibrary/library/Widgets/ParameterAdjustment/ScrollWheel.cpp
Indexer: adding file:/mnt/win_d/Projects/ADS/TV1/LIN/SW/LinEmLibrary/library/Widgets/ParameterAdjustment/ScrollWheel.h
Indexer: adding file:/mnt/win_d/Projects/ADS/TV1/LIN/SW/LinEmLibrary/library/Widgets/ParameterAdjustment/ScrollWheel.cpp
Indexer: processed /LinEmLibrary/library/Widgets/ParameterAdjustment/ScrollWheel.cpp [244 ms]
C/C++ Indexer: Project 'LinEmLibrary' (1 sources, 6 headers)
Options: indexer='PDOMFastIndexer', parseAllFiles=false, unusedHeaders=skip, skipReferences=false, skipImplicitReferences=false, skipTypeReferences=false, skipMacroReferences=false.
Database: 61857792 bytes
Timings: 524 total, 280 parser, 20 resolution, 25 index update.
Errors: 0 internal, 0 include, 0 scanner, 0 syntax errors.
Names: 620 declarations, 1719 references, 0(0.00%) unresolved.
Cache[1023MB]: 1571261 hits, 0(0.00%) misses.
Indexer: completed PDOMUpdateTask[524ms]
Here the indexer says it is adding and processing ScrollWheel.h and reports there are no unresolved Names.
Another important note is that the project was working fine (absolutely no issues with the Indexer) until I upgraded my system. I changed my drive from a 512G SSD to 1TB SSD. Also my project uses Log4CPlus and Google Protobuf, their headers are now installed in /usr/local/include. No change in OS (Ubuntu 20.04) or Eclipse (2021-09). The header file <log4cplus/loggingmacros.h> is no longer discovered by the indexer making all the Log4CPlus macros unresolved leaving a lot of red marks by CODAN. The auto complete is another part which seriously cripples writing code. Now every time I type in a '.' or '->' after an object the auto-complete takes a good amount of time (~30 seconds) before returning the list.
Attachment: ScrollWheel.log
(Size: 633.84KB, Downloaded 75 times)
Attachment: .options
(Size: 0.49KB, Downloaded 109 times)
|
|
|
Powered by
FUDForum. Page generated in 0.05852 seconds