Eclipse Juno 的“预处理器包括路径、宏等” CDT 符号扫描仪

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/11125703/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 18:23:36  来源:igfitidea点击:

Eclipse Juno's "Preprocessor Include Paths, Macros etc." symbol scanner for CDT

eclipseeclipse-cdteclipse-juno

提问by Jeff Lamb

So there has been an overhaul of the scanner discovery as worked on here:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=290631
http://dev.eclipse.org/mhonarc/lists/cdt-dev/msg24345.html

因此,这里对扫描仪发现进行了彻底改革:
https: //bugs.eclipse.org/bugs/show_bug.cgi? id =
290631 http://dev.eclipse.org/mhonarc/lists/cdt- dev/msg24345.html

However, I can't find any information on how to use it. I upgraded from Helios to Juno recently and now I have 8000 "Semantic Errors" and a ton of unresolved includes. However, I can't figure out how to use this new feature. I don't think there's any documentation yet, either.

但是,我找不到有关如何使用它的任何信息。我最近从 Helios 升级到 Juno,现在我有 8000 个“语义错误”和大量未解决的包含。但是,我不知道如何使用这个新功能。我认为目前还没有任何文档。

I think the intent is it will scan your project and automatically discover macros and include directories in order to aid in symbol resolution and project navigation.

我认为目的是它会扫描您的项目并自动发现宏并包含目录以帮助符号解析和项目导航。

I'll keep working on it and update this question if I ever figure it out.

如果我弄清楚了,我会继续研究它并更新这个问题。

回答by Jeff Lamb

Figured it out.

弄清楚了。

Used this as a guide: https://developer.mozilla.org/en/Eclipse_CDT

以此作为指南:https: //developer.mozilla.org/en/Eclipse_CDT

In the project properties, "C/C++ Build", I replaced the default build command with my build command. I had to remove a -s switch (silent switch) so the output parser could grab all the paths and macros from the compiler commands. Pointed the "build directory" to the directory with my makefile.

在项目属性“C/C++ Build”中,我用我的构建命令替换了默认的构建命令。我不得不删除一个 -s 开关(静默开关),以便输出解析器可以从编译器命令中获取所有路径和宏。将“构建目录”指向我的生成文件所在的目录。

Under "C/C++ General" > "Preprocessor Include Paths, Macros etc." > "Providers" I selected CDT User Setting Entries and CDT GCC Build Output Parser. I then had to change the compiler command pattern to match my gcc cross compiler. To do that, I just changed "gcc" to "arm-elf-gcc".

在“C/C++ 常规”>“预处理器包括路径、宏等”下。> "Providers" 我选择了 CDT 用户设置条目和 CDT GCC 构建输出解析器。然后我不得不更改编译器命令模式以匹配我的 gcc 交叉编译器。为此,我只是将“gcc”更改为“arm-elf-gcc”。

After a full build (do not use multi-core builds for the first indexing), right click your project, click 'index' and 'rebuild'. After this, the output parser populated the indexes correctly and they showed up under "C/C++ General" > "Preprocessor Include Paths, Macros etc." > "Entries"

完整构建后(不要对第一次索引使用多核构建),右键单击您的项目,单击“索引”和“重建”。此后,输出解析器正确填充索引,它们显示在“C/C++ 常规”>“预处理器包含路径、宏等”下。> “条目”