user966085
user966085

Reputation: 303

refresh eclipse cdt system includes

I'm using ecipse cdt developing c++ program. A problem is I moved all my workspace and eclipse package from turbolinux to centos linux. Then it cause a problem, that is system includes are different, but eclipse didn't refresh the include paths. And all the std container classes can not be solved.

Anyone know how to fix this problem?

Upvotes: 10

Views: 9047

Answers (3)

MarcusD
MarcusD

Reputation: 11

In the newest Eclipse CDT Mars.1 Release (4.5.1) you'll have to delete the ${WORKSPACE}/.metadata/.plugins/org.eclipse.cdt.core/${PROJECTNAME}.randomnumbers.pdom file, and after opening the project, Eclipse should automatically start to reindex the includes.

Upvotes: 1

Joe
Joe

Reputation: 3160

Checked for Eclipse Luna 4.4.0 with Cdt 8.4.0.201406111759.

You may have a look to your workspace/.metadata/.plugins/org.eclipse.cdt.core/ and check for a file named like YourProjectName.language.settings.xml.

Delete this file (better should backup before), then reopen your project (or restart Eclipse) and Cdt should trigger the the GCC Builtin Discovery.

Note that this way may only applyable if your settings are set to project specific Builtin Discovery (not for »Use global provider shared between projects«). → see Project Properties → C/C++ General → Preprocessor Include Paths, Macros etc. → Providers → CDT GCC Built-in Compiler Settings.

For older Eclipse versions (IMHO about until Indigo), the scanner cache files were placed in workspace/.metadata/.plugins/org.eclipse.cdt.make.core/ and named like YourProjectName.sc.

Upvotes: 1

qethanm
qethanm

Reputation: 398

I was recently bitten by this one myself (actually came to this site in search of an answer ;-) so I'll share what I found:

(these steps reflect Eclipse Indigo SR1)

First, double-check that Eclipse still reflects the old include paths:

  • project -> properties -> C/C++ General -> Paths and Symbols -> GNU C++

Next, clear the old paths:

  • project -> properties -> C/C++ Build -> Discovery Options -> GCC C++ Compiler

  • click the button for "Clear discovered entries now"

Rebuild your project, such that Eclipse picks up on the new include paths

Confirm that the new include paths are set:

  • project -> properties -> C/C++ General -> Paths and Symbols -> GNU C++

Upvotes: 12

Related Questions