Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

DeltaEKs

macrumors newbie
Original poster
I'm currently in college pursuing a degree in computer science. I'm trying to do all my homework in Xcode and so far it's worked out fairly well. However, I don't get why I'm getting a compiler error message when I type out the following into a class file:

Code:
friend ostream & operator<< (ostream & output, const DateType & aDate);

The error message is "Unknown type name 'ostream.'" I have tried including #include <fstream>, #include <iostream>, and #include <ifstream> (which seems to clear this error, but makes a new error saying "ifstream file can't be found")

Any ideas on how to get this to work? I know Xcode has a few things that are incompatible with code taken from Windows compilers.

And I guess while we're on the topic, is there anything I should know about programming for mac in general? I'm being taught in a Windows-oriented class setting and even though I can switch to my bootcamp side any time if I need to finish a project, I want to milk every ounce of usability out of Xcode as possible. (And besides, Xcode is so much easier to work with)
 
Apparently you're not yet aware of namespaces!

Code:
friend std::ostream & operator<< (std::ostream & output, const DateType & aDate);
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.