未解决的包含:<iostream> 在 mac 上的 eclipse 中

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

Unresolved inclusion: <iostream> in eclipse on mac

eclipsemacoscompiler-constructioneclipse-indigo

提问by sinθ

Eclipse will not allow me to include <iostream>. I'm on a mac and when I try the same thing using xcode it works. I'm running eclipse Indigo and I've tried both the MAc OS X compiler option and the cross platform one.

Eclipse 不允许我将<iostream>. 我在 mac 上,当我使用 xcode 尝试同样的事情时,它可以工作。我正在运行 eclipse Indigo,并且尝试了 MAC OS X 编译器选项和跨平台编译器选项。

回答by Dolan Antenucci

I resolved this by manually adding the path to iostream to my project:

我通过手动将 iostream 的路径添加到我的项目中解决了这个问题:

Right click on project -> Properties -> C/C++ General -> Paths and Sympols -> GNU C++ (under Languages column in Includes) -> Add

右键单击项目 -> 属性 -> C/C++ General -> Paths and Sympols -> GNU C++(在 Includes 的 Languages 列下)-> Add

I added the following (the ones in Bold) -- I think the second one is what you need:

我添加了以下内容(粗体)——我认为第二个是你需要的:

screenshot of my elcipse settings

我的 elcipse 设置的屏幕截图