Thread: This Program cannot be run under dos?

  1. #1

    This Program cannot be run under dos?

    I get this error "This Program cannot be run under dos" when i compile and try to run this.
    Code:
    #include <iostream.h>
    
    int main()
    {
       std::cout << "Test\n";
       int x;
       std::cin >> x;
       return 0;
    }
    do i not know something?

  2. #2
    Confused Magos's Avatar
    Join Date
    Sep 2001
    Location
    Sweden
    Posts
    3,145
    You use the old *.h and the new std namespace?
    MagosX.com

    Give a man a fish and you feed him for a day.
    Teach a man to fish and you feed him for a lifetime.

  3. #3
    Banal internet user
    Join Date
    Aug 2002
    Posts
    1,380
    What compiler are you using?

    9/10 of the voices in my head believe that you are compiling a Win32 Console app

  4. #4
    i learned to use iostream.h? umm u have to use namespace std or something? talk to jessie liberty about that one.
    how do u compile a dos exe? special compiler or someting?

  5. #5
    Banal internet user
    Join Date
    Aug 2002
    Posts
    1,380
    You would need a genuine DOS compiler, like Turbo C.

  6. #6
    life makes sense now, though i said screw dos, and got MSVC++ :-D

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How to time how long a program takes to run?
    By advancedk in forum C Programming
    Replies: 2
    Last Post: 08-18-2008, 07:50 PM
  2. Replies: 4
    Last Post: 07-24-2008, 09:02 AM
  3. fopen();
    By GanglyLamb in forum C Programming
    Replies: 8
    Last Post: 11-03-2002, 12:39 PM
  4. program won't run standalone
    By richard in forum C++ Programming
    Replies: 2
    Last Post: 07-20-2002, 06:21 PM
  5. initialising a DOS program from a C enviroment
    By Robert_Ingleby in forum C Programming
    Replies: 5
    Last Post: 03-07-2002, 01:53 PM