未解决的< iostream>在Eclipse中,Ubuntu [英] Unresolved <iostream> in Eclipse, Ubuntu
问题描述
是的,这是这个问题...
Yes, it's this question again...
不知何故,我无法解决这个问题。相信与否,我有Eclipse的经验,但只适用于Java开发。我已经用C ++编程,但没有使用Eclipse。
Somehow, I cannot get this issue resolved. Believe it or not, I have experience with Eclipse but only for Java development. I have programmed in C++ using vi but not with Eclipse.
我已经安装了:
- Ubuntu 12.04
- Eclipse 3.7.2
- GCC 4.6.3
- Eclipse CDT 8.0。 2
- Ubuntu 12.04
- Eclipse 3.7.2
- GCC 4.6.3
- Eclipse CDT 8.0.2
我创建了一个空的Makefile项目,并选择了Linux GNU工具链:
I created an empty Makefile project and selected the Linux GNU Toolchain:
我得到标准未解决的包含< iostream>
错误,我有一些参考项目中的各种include目录:
I get the standard Unresolved inclusion <iostream>
error, and I have some references to various "include" directories in the project:
我注意到,虽然GNU C的路径和符号设置包含各种路径,但GNU C ++的相同设置为空:
I did notice that, while my "Paths and Symbols" setting for GNU C contains various paths, the same setting for GNU C++ is empty:
另外,我有GNU Elf解析器在我的C / C ++构建设置下:
Also, I have the "GNU Elf Parser" under my C/C++ build settings:
干杯
编辑:
以下是我项目的构建路径的更新照片:
Here's an updated photo of my a project's build path that is working correctly:
推荐答案
原因是Eclipse根本无法导入适当的标题。可以在Ubuntu中找到C ++ iostream头文件:
The reason is that Eclipse simply cannot import a proper header. C++ iostream header in Ubuntu can be found:
$:sudo find / -name iostream
$: sudo find / -name iostream
/home/beniamin/QtSDK/Madde/toolchains/arm-2009q3-67-arm-none-linux-gnueabi-x86_64-unknown-linux-gnu/arm-2009q3-67/arm-none-linux-gnueabi/include/c++/4.4.1/iostream
/home/beniamin/QtSDK/Madde/sysroots/harmattan_sysroot_10.2011.34-1_slim/usr/include/c++/4.4/iostream
/usr/share/gccxml-0.9/GCC/2.95/iostream
/usr/include/c++/4.6/iostream
/usr/include/boost/tr1/tr1/iostream
所以基本上,我想你正在寻找的是 / usr / include / c ++ / 4.6 / iostream
,所以你应该在某个地方包括这个目录。
So basically, I suppose the one you are looking for is /usr/include/c++/4.6/iostream
, so you should in some place include this directory.
编辑:你也应该安装g ++,或者只是安装build-essential包,这是建立debian包的义务。不过,g ++应该已经包含在您的Ubuntu安装中。
You should also have installed g++, or simply install build-essential package, which is obligatory for building debian packages. Nevertheless, g++ should have been included in your Ubuntu installation anyway.
这篇关于未解决的< iostream>在Eclipse中,Ubuntu的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!