3

I've recently downloaded Eclipse C++ for Mac.

I've just opened up a basic project however the library <iostream> gives an error "unresolved inclusion: <iostream>" and also I get the same errors with 'cout', 'endl' as well.

I have searched it up before coming here and people were talking about tool chain and etc but none of them worked out for me. I would like if someone could give me the basic steps to workout this problem.

Joachim Isaksson
  • 176,943
  • 25
  • 281
  • 294
Ali
  • 5,338
  • 12
  • 55
  • 78

2 Answers2

6

You need to locate the iostream.h file. Try this:

In your Eclipse's project, go to Properties > C/C++ General > Paths and Symbols, and select the "Includes" tab. Select "GNU C++" in the Language list and click "Add" to include a directory. Now, browse for C++ sources: on Mac, these should be locate in /usr/include/c++.

Hope this helps.

Julien Ribon
  • 265
  • 3
  • 9
  • Thanks a lot, It solves my issue! However, can I let eclipse include these header files by default instead of doing it for each project? – Alex Mar 18 '15 at 22:43
1

I had to be more specific in the paths I used. See my description over at: https://stackoverflow.com/a/12499629/318870

Community
  • 1
  • 1
Dolan Antenucci
  • 15,432
  • 17
  • 74
  • 100