如何删除错误"尚未解决的包容"在Eclipse IDE的用户定义的路径 [英] How to remove error "unresolved inclusion" for user defined path in eclipse IDE

查看:491
本文介绍了如何删除错误"尚未解决的包容"在Eclipse IDE的用户定义的路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经导入现有的IAR C ++项目为ARM进入Eclipse IDE中,用插件添加了IAR工具链。该项目得到了进口,但没有得到包括了一些文件。它提供了错误:。未解决的包容性和文本与这些文件红色我已经添加下划线的路径如下图所示,但仍相同的错误有请建议去除这个错误

i have imported existing IAR C++ Project for ARM into eclipse IDE , with plugin added for IAR tool chain. The project got imported , but some files are not getting included. It gives error :Unresolved inclusion" and text is underlined with red color. I have added path for these files as shown below but still same error is there . Please suggest for removing this error.

推荐答案

您需要正确配置Eclipse的索引。如果你的项目的类型是生成文件项目(所以不是任何托管式,在那里你在Eclipse中输入编译选项/标志),你可以做到这一点,如下所述。

You need to configure Eclipse's indexer properly. If your project's type is "Makefile project" (so not any "managed" type, where you enter the compilation options/flags in Eclipse) you can do that as described below.

转到您的项目的属性,然后选择C / C ++通用>preprocessor包括路径,宏等。并切换到提供者选项卡。取消选中一切除外:

Go to your project's properties, then "C/C++ General" > "Preprocessor Include Paths, Macros etc." and switch to "Providers" tab. Uncheck everything other than:


  • CDT GCC编译输出解析器,

  • CDT跨GCC内置的编译器设置(取决于您的项目确切类型,这应该是一些其他类型的 - 为跨海湾项目,选择...十字GCC ...复选框)。

配置它们,如下图:


在第一种情况下更换:

(GCC)|([GC] \\ + \\ +)|(铛)

*((GCC)|([GC] \\ + \\ +)|(铛))。

这样Eclipse会知道,开始...臂无 - EABI - 海合会...或所有行......臂无 - EABI-G ++ ......是编译器调用,因此它将能够解析标志,包括包含路径(-I标志)。您可以更改选项文件/文件夹/项目 - 根据您的配置

This way Eclipse will know that all your lines starting with "... arm-none-eabi-gcc ..." or "... arm-none-eabi-g++ ..." are compiler invocations, so it will be able to parse the flags, including the include paths (-I flags). You can alter the options File/Folder/Project - depending on your configuration.

在第二种情况下更换什么是在文本框中类似的东西:

In the second case you replace what's in the textbox with something similar to:

ARM-NONE-EABI - $ {COMMAND} $ {} FLAGS -E -P -v -dD$ {} INPUTS-std = GNU + 11 = -std gnu99 -mcpu =皮质-M4 -mthumb

和你需要指定适当的标志,这取决于你的项目。您只输入,对于内置的编译器设置的重要标志 - 这是-std,-mcpu,-mthumb,-mfpu等,正如你看到的,你应该为C和C ++(如果你使用输入标志C ++)。

And you need to specify proper flags, depending on your project. You enter only the flags that matter for the "built-in compiler settings" - these are -std, -mcpu, -mthumb, -mfpu, etc. As you see, you should enter flags for both C and C++ (if you use C++).

当然,如果你的编译器preFIX不是臂无-eabi-你应该相应地修改选项。

Of course if your compiler prefix is not "arm-none-eabi-" you should modify the options accordingly.

之后,你应该做一个完整的重建项目,这样的Eclipse将能够看到您的项目中所有文件的所有编译命令。如果你的Makefile隐藏实际的命令(例如只显示CC:some_file.c,而不是可以真正执行完整的命令),此功能已被禁用(你可以改变提出的是在项目的属性C下调用方式/ C ++编译中的生成(增量编译)行为选项卡中的文本框)。

After that you should do a full rebuild of your project, so that Eclipse would be able to see ALL compilation commands for ALL files from your project. If your makefile hides the actual commands (for example it displays only "CC: some_file.c" instead of full command that is actually executed) this feature has to be disabled (you can alter the way make is invoked in project's properties under "C/C++ Build" in "Behavior" tab in "Build (incremental build)" textbox).

有时还需要手动重建索引,因此右键单击您的项目,进入目录>重建(有时其他选项可以帮助太)。关闭所有的编辑,甚至关闭该项目,并重新打开后,应该没问题。

Sometimes it is also necessary to rebuild index manually, so right-click your project and go to "Index" > "Rebuild" (sometimes other options help too). Close all editors, maybe even close the project, and after reopening it should be OK.

在所有这些步骤你应该看到在你的源代码一个小的扳手图标(或文件夹或整个项目 - 根据您在解析器选择什么) - 你点击这样的元素,用鼠标右键,选择属性,C后/ C ++通用>preprocessor包括路径,宏等。你应该能够看到Eclipse中发现的有:

After all these steps you should see a small "wrench" icons on your sources (or folders or whole project - depending on what you selected in the parser) - after you click such element with right button, select Properties and "C/C++ General" > "Preprocessor Include Paths, Macros etc." you should be able to see what Eclipse discovered there:

这篇关于如何删除错误"尚未解决的包容"在Eclipse IDE的用户定义的路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆