eclipse 如何在c ++中处理eclipse中未解决的包含

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/14137891/
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 19:44:22  来源:igfitidea点击:

How to deal with unresolved inclusion in eclipse in c++

c++eclipseinclude

提问by user1853170

I import two self-defined project: projectA and projectB the classes in projectA include headers in project B but eclipse always show some yellow and red lines to say that unresolved inclusion. (I am sure that all the syntax and setting about include are correct, since they are projects has been developed and used for a long time) How to deal with that?

我导入了两个自定义项目:projectA 和 projectB,projectA 中的类包含项目 B 中的标题,但 eclipse 总是显示一些黄色和红色线条表示未解决的包含。(我确定所有关于include的语法和设置都是正确的,因为它们是已经开发并使用了很长时间的项目)如何处理?

do I need to right click project and do index->rebuild or something else?

我是否需要右键单击项目并执行索引-> 重建或其他操作?

回答by AngelCastillo

You can set path to the header files of projectB in projectA under:

您可以在projectA下设置projectB头文件的路径:

Project -> Properties -> C/C++ Build -> Settings -> Compiler -> Includes

项目 -> 属性 -> C/C++ 构建 -> 设置 -> 编译器 -> 包含

enter image description here

在此处输入图片说明