refresh eclipse cdt system includes

北慕城南 提交于 2020-01-01 09:12:04

问题


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?


回答1:


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++



回答2:


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.




回答3:


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.



来源:https://stackoverflow.com/questions/8569945/refresh-eclipse-cdt-system-includes

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!