Thread: help with compiler

  1. #1
    Registered User
    Join Date
    Oct 2003
    Posts
    3

    help with compiler

    hey, i'm a newbie, and by newbie meaning i've just downloaded my first compiler. i downloaded the Bloodshed Dev C++ (which i hear is a really good one) but i'm having a problem with it. i open up a new Console Applicatio, put in the sample code they gave:

    Code:
    #include <iostream.h>
    int main()
    {
      cout<<"The Compiler Works";
      return 0;
    }
    and clicked Execute-Compile. then hit Execute-Run. when i do that, a message comes up saying "project is not compiled" that's all the tutorial i was looking at told me to do, is there's something i'm missing. also, after i hit Execute-Compile, in the small table at the bottom of the window is says "Line: 2, File: C:\Dev-Cpp\... Message: unable to run program file" any help is appreciated, as i would really like to get past this very first step of learning C++

  2. #2
    Disturbed Boy gustavosserra's Avatar
    Join Date
    Apr 2003
    Posts
    244
    I just press F9 and everthing works!
    Nothing more to tell about me...
    Happy day =)

  3. #3
    Registered User
    Join Date
    Oct 2003
    Posts
    3
    why? what's F9 do?

  4. #4
    Disturbed Boy gustavosserra's Avatar
    Join Date
    Apr 2003
    Posts
    244
    Compile and Run
    Nothing more to tell about me...
    Happy day =)

  5. #5
    Registered User
    Join Date
    Jan 2002
    Location
    Vancouver
    Posts
    2,212
    Code:
    #include <iostream>
    
    using namespace std;
    
    int main()
    {
            cout << "The Compiler Works." << endl;
            return 0;
    }

  6. #6
    Registered User
    Join Date
    Oct 2003
    Posts
    3
    you know what, it may be something wrong with the complier/my computer, and maybe not the code. i tried inputting all difference kinds of code i gathered from places, just to see if it works, and i got the same problem. i uninstalled the compiler, i may try redownloading it.

  7. #7
    Registered User
    Join Date
    Aug 2003
    Posts
    25

    catapilar

    Code:
    #include <iostream.h>}change to just <iostream> 
    
    using namespace std;  // add what Brian said here.. 
    
    int main()
    {
      cout<<"The Compiler Works";
    
    system ("pause"); //  add this here, it pauses the screen so you can see what you did 
    
     return 0;
    }
    Last edited by teeyester; 10-19-2003 at 02:15 PM.

  8. #8
    The Defective GRAPE Lurker's Avatar
    Join Date
    Feb 2003
    Posts
    949
    He can't even compile yet, the code isn't going to help him. Although it is correct. Cater the code you are testing is outdated, be sure to use the new code they posted when you get everything working.
    Do not make direct eye contact with me.

  9. #9
    Disturbed Boy gustavosserra's Avatar
    Join Date
    Apr 2003
    Posts
    244
    Why doesnīt him remove that .h from the include???
    Nothing more to tell about me...
    Happy day =)

  10. #10
    Disturbed Boy gustavosserra's Avatar
    Join Date
    Apr 2003
    Posts
    244

    Talking

    Sorry teeyester didnīt see your post!
    Nothing more to tell about me...
    Happy day =)

  11. #11
    Registered User
    Join Date
    Aug 2003
    Posts
    1,218

    Re: catapilar

    Originally posted by teeyester
    Code:
    #include <iostream.h>}change to just <iostream> 
    
    using namespace std;  // add what Brian said here.. 
    
    int main()
    {
      cout<<"The Compiler Works";
    
    system ("pause"); //  add this here, it pauses the screen so you can see what you did 
    
     return 0;
    }
    that wont work, here is the correct one:
    Code:
    #include <iostream>
    #include <cstdlib> // This is needed for system("pause");
    using namespace std;
    int main()
    {
        cout << "The Compiler Works";
        system("pause");
        return 0;
    }

  12. #12
    Registered User
    Join Date
    Oct 2003
    Posts
    24
    sometimes you don't even need the system to pause.. If you are returning a 0 ie. return 0; then the system will say "press any key to continue."

    After you hit the key the window will close. This is a software related issue and will require one of the following:

    1) Update on current software
    2) Reinstall
    3) New complier software

    Hope this helps

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Compiler Paths...
    By Cobra in forum C++ Programming
    Replies: 5
    Last Post: 09-26-2006, 04:04 AM
  2. C Compiler and stuff
    By pal1ndr0me in forum C Programming
    Replies: 10
    Last Post: 07-21-2006, 11:07 AM
  3. I can't get this new compiler to work.
    By Loduwijk in forum C++ Programming
    Replies: 7
    Last Post: 03-29-2006, 06:42 AM
  4. how to call a compiler?
    By castlelight in forum C Programming
    Replies: 3
    Last Post: 11-22-2005, 11:28 AM
  5. Bad code or bad compiler?
    By musayume in forum C Programming
    Replies: 3
    Last Post: 10-22-2001, 09:08 PM