简体   繁体   English

刷新eclipse cdt系统包括

[英]refresh eclipse cdt system includes

I'm using ecipse cdt developing c++ program. 我正在使用ecipse cdt开发c ++程序。 A problem is I moved all my workspace and eclipse package from turbolinux to centos linux. 问题是我将所有工作空间和eclipse包从turbolinux移动到centos linux。 Then it cause a problem, that is system includes are different, but eclipse didn't refresh the include paths. 然后它引起一个问题,那就是系统包含的不同,但eclipse没有刷新包含路径。 And all the std container classes can not be solved. 并且所有std容器类都无法解决。

Anyone know how to fix this problem? 有谁知道如何解决这个问题?

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) (这些步骤反映了Eclipse Indigo SR1)

First, double-check that Eclipse still reflects the old include paths: 首先,仔细检查Eclipse是否仍然反映旧的包含路径:

  • project -> properties -> C/C++ General -> Paths and Symbols -> GNU C++ 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 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 重建您的项目,以便Eclipse选择新的包含路径

Confirm that the new include paths are set: 确认已设置新的包含路径:

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

Checked for Eclipse Luna 4.4.0 with Cdt 8.4.0.201406111759. 检查Eclipse Luna 4.4.0与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 . 您可以查看workspace/.metadata/.plugins/org.eclipse.cdt.core/并检查名为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. 删除此文件(最好在之前备份),然后重新打开项目(或重新启动Eclipse),Cdt应该触发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«). 请注意,只有将您的设置设置为项目特定的Builtin Discovery(不适用于»使用项目之间共享的全局提供程序«)时,这种方式才可用。 → see Project Properties → C/C++ General → Preprocessor Include Paths, Macros etc. → Providers → CDT GCC Built-in Compiler Settings . →请参阅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 . 对于较旧的Eclipse版本(恕我直言,直到Indigo),扫描程序缓存文件放在workspace/.metadata/.plugins/org.eclipse.cdt.make.core/并命名为YourProjectName.sc

在最新的Eclipse CDT Mars.1发行版(4.5.1)中,您必须删除${WORKSPACE}/.metadata/.plugins/org.eclipse.cdt.core/${PROJECTNAME}.randomnumbers.pdom文件,在打开项目之后,Eclipse应该自动开始重新索引包含。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM