www.digitalmars.com         C & C++   DMDScript  

c++ - "using namespace std;" declaration fails

reply Jordon Hirshon <jbhirshon yahoo.com> writes:
I'm trying to compile a simple ".cpp" file with the command line: sc filename
-I/dm/stlport/stlport.  It produces: "Error: identifier expected" at the
semicolon of std.

I browsed through some of the posts on the forum, but nothing worked.

Any suggestions?

Thanks,
Jordon Hirshon
Apr 11 2010
parent reply Walter Bright <newshound1 digitalmars.com> writes:
Jordon Hirshon wrote:
 I'm trying to compile a simple ".cpp" file with the command line: sc filename
 -I/dm/stlport/stlport.  It produces: "Error: identifier expected" at the
 semicolon of std.
 
 I browsed through some of the posts on the forum, but nothing worked.
 
 Any suggestions?
Please post the exact source code of the file you're trying to compile.
Apr 13 2010
parent Jordon Hirshon <jbhirshon yahoo.com> writes:
Here's the file I'm trying to compile.  I'm using version 8.29.21n of the
Digital
Mars compiler.

I'm using this command to compile:
 dmc test_hello -I\dm\stlport\stlport

Thanks for your help.

#include <iostream>

using namespace std;

int main()
{
    cout << "Hello world\n";
}
Apr 13 2010