Computer Science Canada

iostream error

Author:  connorc [ Thu Apr 10, 2008 2:29 am ]
Post subject:  iostream error

I tried to compile this simple program to see why my iostream header <iosteam> is not working,


#include <iostream>

int main(void)
{
return 0;
}



and i got this error on MVS8,


Compiling...
main.cpp
c:\program files\microsoft visual studio 8\vc\include\iostream(42) : warning C4068: unknown pragma
c:\program files\microsoft visual studio 8\vc\include\cstdlib(23) : error C2039: 'exit' : is not a member of '`global namespace''
c:\program files\microsoft visual studio 8\vc\include\cstdlib(23) : error C2873: 'exit' : symbol cannot be used in a using-declaration
c:\documents and settings\hp_owner\desktop\triple triad\tt\main.cpp(4) : error C2084: function 'int main(void)' already has a body
c:\program files\microsoft visual studio 8\vc\include\istream(6) : see previous definition of 'main'
Build log was saved at "file://c:\Documents and Settings\HP_Owner\Desktop\Triple Triad\TT\Debug\BuildLog.htm"
TT - 3 error(s), 1 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Help please.

Author:  Dragan [ Thu Apr 10, 2008 3:53 am ]
Post subject:  RE:iostream error

That code is ok. , try that code with new blank workspace.

Author:  wtd [ Thu Apr 10, 2008 8:38 am ]
Post subject:  RE:iostream error

I know the solution.

Use GCC.

Author:  md [ Thu Apr 10, 2008 10:41 am ]
Post subject:  RE:iostream error

Definitely seems like a microsoft error, I second using a decent compiler.


: