简体   繁体   English

Eclipse中未解决的包含

[英]Unresolved inclusion in Eclipse

I have Eclipse version 3.8.1, with which I write Java code. 我有Eclipse版本3.8.1,可用来编写Java代码。 I recently started writing in c\\c++, and I'm having some troubles when trying to install the CDT (C\\C++ development tooling) plugin. 我最近开始用c \\ c ++编写,尝试安装CDT(C \\ C ++开发工具)插件时遇到了一些麻烦。
I know this question was asked a lot, and I've searched for answers in previous posts here, but none of the suggested answers were relevant, or they did not help. 我知道这个问题被问了很多,我已经在这里以前的帖子中搜索了答案,但是建议的答案都没有意义,或者没有帮助。

Let me first give you a brief of what I have done so far: 首先,让我简要介绍一下到目前为止的工作:

Help -> install new software ->" Available software sites ", and then in the preferences window I added the location: http://download.eclipse.org/tools/cdt/releases/kepler/ and then installed the plugin. 帮助 -> 安装新软件 ->“ 可用软件站点 ”,然后在首选项窗口中添加以下位置: http : //download.eclipse.org/tools/cdt/releases/kepler/ ,然后安装了插件。
Indeed, after reopening eclipse, I now have new available options at the "File->new..." menu, like "C++ project/C project" and so on. 确实,在重新打开eclipse之后,我现在在“文件->新建...”菜单中有了新的可用选项,例如“ C ++项目/ C项目”等等。

When I choose to create a new project, I then have this window presented: 当我选择创建一个新项目时,将显示以下窗口: 在此处输入图片说明

I then choose "Linux GCC" (I have no idea what the rest are), and creating a new source file. 然后,我选择“ Linux GCC”(我不知道其余的是什么),并创建一个新的源文件。

The problem is this: 问题是这样的: 在此处输入图片说明

I'm getting "Unresolved inclusion" to the iostream file, even though I have all the necessary .h files, as you can see in the left pane of the window (under "includes"). 即使我具有所有必需的.h文件,我仍在iostream文件中获取“未解决的包含”,正如您在窗口的左窗格(在“ includes”下)所看到的那样。

Does anyone know what might be the problem, and how to resolve this issue? 有谁知道可能是什么问题,以及如何解决此问题?

Thanks in advanced! 提前致谢!

edit: 编辑:

the errors appear at the bottom pane of the window, and this "binary not found" error pops whenever I try to compile it. 错误出现在窗口的底部窗格中,并且每当我尝试对其进行编译时,都会弹出此“找不到二进制文件”错误。
There's also the "unresolved inclusion" I was referring to. 我指的还有“未解决的包含”。 it shows it when I hover with the mouse over the "#include" line. 当我将鼠标悬停在“ #include”行上时,它会显示它。

在此处输入图片说明

The screenshot only shows that the directories exist, not that the right files within them exist. 屏幕快照仅显示目录存在,而不显示其中的正确文件。

To fix these kind of dependency issues: 要解决以下依赖性问题:

sudo apt-get --install-suggests install eclipse-cdt

or on yum-based distributions 或基于yum的发行版

sudo yum install eclipse-cdt

This should install all the necessary dependencies. 这应该安装所有必需的依赖项。 If it installs eclipse-cdt but doesn't install all its dependencies on your distribution, well that's a bug in that distribution. 如果安装Eclipse的CDT但你的版本没有安装所有的依赖关系,那么这是在分发中的错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM