Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Question, issues about C++ Indexer behavior
Question, issues about C++ Indexer behavior [message #1451123] Thu, 23 October 2014 11:18 Go to next message
Jack Jones is currently offline Jack JonesFriend
Messages: 3
Registered: October 2014
Junior Member
Good day to everyone,

Before I explain my situation, I'd like to give you an idea of my developing environment:

  • Windows 7, 64 bit
  • Eclipse Luna SR1 + CDT 8.5
  • TDM-GCC's MinGW 4.8.1
Okay... So, two days ago, I started having trouble with the C++ Indexer, in the form of the "Autocomplete" and "Organize includes"/"Add include" features pretty much not working as intended.

Allow me to explain. I can autocomplete keywords and loop structures, as well as include statements, whether from the standard libraries bundled with TDM-GCC's MinGW 4.8.1 or external libraries that I include in the project, (so Eclipse knows where to get them, and I checked that they do exist in the project's default Include Paths). However, I cannot autocomplete classes and methods that are contained within those standard/external libraries, nor I can use "Organize includes"/"Add include" to automatically populate my source code with the appropriate include statements.

I've tried rebuilding the C++ Index multiple times, deleting the metadata of the workspace, importing my projects to a whole new workspace and, even, reinstalling the whole Eclipse IDE + CDT 8.5, but nothing solved the issue. The applications I'm building compile and run flawlessly, so it's not an issue of whether Eclipse knows where to look for those headers or not.

There is one thing that baffles me about this whole situation, which is the fact that if I input an include statement manually then rebuild the C++ index, the "Autocomplete" and "Organize includes"/"Add include" features will work flawlessly. However, they will do so only for that header on any file of this project.

I don't know how the C++ Indexer works exactly, but I was under the impression that it should parse the files listed in the Include Paths, including both paths to standard libraries and external libraries. For example, assuming that I'm working with SFML 2.1, these are the Include Paths that I would assume the C++ Indexer must parse but, for some reason, doesn't:

"d:/c++ libs/sfml 2.1/include"
"d:/tdm-gcc-64/include"
"d:/tdm-gcc-64/lib/gcc/x86_64-w64-mingw32/4.8.1/include"
"d:/tdm-gcc-64/lib/gcc/x86_64-w64-mingw32/4.8.1/include/c++"
"d:/tdm-gcc-64/lib/gcc/x86_64-w64-mingw32/4.8.1/include/c++/backward"
"d:/tdm-gcc-64/lib/gcc/x86_64-w64-mingw32/4.8.1/include/c++/x86_64-w64-mingw32"
"d:/tdm-gcc-64/lib/gcc/x86_64-w64-mingw32/4.8.1/include-fixed"
"d:/tdm-gcc-64/x86_64-w64-mingw32/include"

I have confirmed that those paths contain the headers of both SFML 2.1 headers and the standard library.

Is this the standard behavior of the C++ Indexer?

Edit: Clarify that both "Organize includes" (CTRL + SHIFT + O) and "Add include" (CTRL + SHIFT + N) have the same weird behavior.

[Updated on: Fri, 24 October 2014 11:42]

Report message to a moderator

Re: Question, issues about C++ Indexer behavior [message #1451836 is a reply to message #1451123] Fri, 24 October 2014 11:06 Go to previous messageGo to next message
Jack Jones is currently offline Jack JonesFriend
Messages: 3
Registered: October 2014
Junior Member
I have confirmed that this behavior is present on:

Eclipse Kepler + CDT 8.3 on Windows 7, 64 bits     with TDM-GCC's MinGW 4.8.1, 64 bits
Eclipse Kepler + CDT 8.3 on Xubuntu 12.04, 64 bits with G++ 4.6.3, 64 bits
Eclipse Luna   + CDT 8.5 on Xubuntu 12.04, 64 bits with G++ 4.6.3, 64 bits

All of them tested on multiple physical and virtual machines with fresh Eclipse installations.

I also found that Eclipse can autocomplete C Standard Libraries' methods and datastructures, as well as perform correctly the "Add include" task for them. However, the "Organize includes", for some reason, doesn't.
Re: Question, issues about C++ Indexer behavior [message #1452055 is a reply to message #1451836] Fri, 24 October 2014 18:28 Go to previous message
Jack Jones is currently offline Jack JonesFriend
Messages: 3
Registered: October 2014
Junior Member
Okay... I thought this might be easy, like the autocompletion and import organization in Java. I'm an idiot.

The guys at Eclipse's Bugzilla explained to me that that is the intended behavior. Considerations like the time it takes to parse the whole standard library makes it impossible to pre-parse the whole library during a project's creation, and symbols present in the project might change the visibility and behavior of classes and methods so there cannot exist a pre-built index for the standard library.
Previous Topic:Problems while debugging large project
Next Topic:Getting Text file instead.
Goto Forum:
  


Current Time: Thu Nov 07 11:05:19 GMT 2024

Powered by FUDForum. Page generated in 0.04372 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top