Search code examples
c++eclipseintellisensecode-completioneclipse-cdt

Eclipse CDT Code Completion Issue


For some reason the code completion for the Eclipse CDT I'm running (in Ubuntu linux) isn't working properly. Every time I include a library nothing pops up. Is there any reason why this could be?


Solution

  • Including a header in your source code is not enough. You need to tell the indexer where to look for the header. To do so, you need to go to your project's properties, navigate to the C/C++ General > Paths and Symbols item. In the Includes tab, add the folder containing your headers for the GNU C++ language. You may also need to define a few symbols in the Symbols tab if your library needs it.

    Now you'll just have to wait for the indexer to do it's thing and auto-completion should start working. Keep in mind that the indexer isn't perfect and complicated C++ headers like the STL can confuse it pretty easily.