0

I have Eclipse version 3.8.1, with which I write Java code. I recently started writing in c\c++, and I'm having some troubles when trying to install the CDT (C\C++ development tooling) plugin.
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.
Indeed, after reopening eclipse, I now have new available options at the "File->new..." menu, like "C++ project/C project" and so on.

When I choose to create a new project, I then have this window presented: enter image description here

I then choose "Linux GCC" (I have no idea what the rest are), and creating a new source file.

The problem is this: enter image description here

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").

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.

enter image description here

so.very.tired
  • 2,958
  • 4
  • 41
  • 69
  • You could look to http://stackoverflow.com/questions/10373788/c-unresolved-inclusion-iostream/21469917#21469917. It may help ! :) – Alan CN Nov 04 '15 at 17:02

1 Answers1

1

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

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.

Robin Green
  • 32,079
  • 16
  • 104
  • 187
  • Thanks Robin. Tried to run the first command. didn't help (The files were installed, but that didn't resolve this issue). And you're right, the screenshot doesn't show that the files exist, so I checked, and couldn't find "iostream.h" file in there, but I could find "string.h" and "stdio.h", and including them also resulted in an "unresolved inclusion" error, even though they do exist in the files. – so.very.tired Jan 11 '14 at 14:51
  • please copy and paste _all_ the error messages into your question. – Robin Green Jan 11 '14 at 15:00
  • OK, added a picture with all the errors in it. thank you very much for the help. appreciate it. – so.very.tired Jan 11 '14 at 22:37
  • @so.very.tired sorry, I missed an important option to the `apt-get` command - see my edited answer. You can re-run the command with the option. – Robin Green Jan 11 '14 at 23:47
  • It says "eclipse-cdt is already the newest version." after running the edited command. maybe it is something that has to do with eclipse's preferences? it's weird that eclipse has these "includes" folders IN the project, but still fails to resolve them... – so.very.tired Jan 12 '14 at 12:16
  • OK, sorry. First do `apt-get purge eclipse-cdt` and then the modified command. – Robin Green Jan 12 '14 at 12:17
  • Great! it works now (it builds the project and then runs it), but the errors are still there for some reason ("unresolved inclusion" when I hover over the "#include" and the words "std" and "cout" marked with red under-line). I guess it's some bug in the Eclipse IDE. – so.very.tired Jan 12 '14 at 12:40
  • 1
    yes, often Eclipse gets out of sync. Closing and reopening the file, or cleaning the project, should fix that. – Robin Green Jan 12 '14 at 12:40