Thread: #using namespace std;

  1. #1
    Registered User mrafcho001's Avatar
    Join Date
    Jan 2005
    Posts
    483

    #using namespace std;

    I just tried to test something in M$_DOS, and as usual i do:
    Code:
    #include <iostream>
    #using namespace std;
    
    int main()
    {
        //CODE HERE
        return 0;
    }
    then i compile and get 2 error, pretty good i though, but then when i saw the error:
    Code:
    test.cpp(2) : error C2006: '#using' : expected a filename, found 'namespace'
    test.cpp(2) : fatal error C1190: managed targeted code requires '#using <mscorlib.dll>' and '/clr' option
    Maybe its just cuz im a bit dusty on this stuff, but im pretty sure thats how i use to do it?

    Am i spelling something wrong? Did things change?
    Why am i getting an error? how do i get rid of it?
    Last edited by mrafcho001; 11-10-2005 at 05:26 PM.
    My Website
    010000110010101100101011
    Add Color To Your Code!

  2. #2
    Yes, my avatar is stolen anonytmouse's Avatar
    Join Date
    Dec 2002
    Posts
    2,544
    using is not a pre-processor command and therefore is not preceded by a #. A console program is not an MS-DOS program. MSVC.NET can not create MS-DOS programs.

  3. #3
    Registered User mrafcho001's Avatar
    Join Date
    Jan 2005
    Posts
    483
    thats it! no #!

    Thanks
    My Website
    010000110010101100101011
    Add Color To Your Code!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Why std:: and not using namespace std?
    By swappo in forum C++ Programming
    Replies: 4
    Last Post: 07-03-2009, 03:10 PM
  2. std:: or namespace std
    By C-+ in forum C++ Programming
    Replies: 16
    Last Post: 12-04-2007, 12:30 PM
  3. Post...
    By maxorator in forum C++ Programming
    Replies: 12
    Last Post: 10-11-2005, 08:39 AM
  4. need ; before using namespace std
    By wwfarch in forum C++ Programming
    Replies: 7
    Last Post: 05-11-2004, 10:42 PM
  5. Site tutorials
    By Aalmaron in forum C++ Programming
    Replies: 20
    Last Post: 01-06-2004, 02:38 PM