Compiler Issue

This is a discussion on Compiler Issue within the C++ Programming forums, part of the General Programming Boards category; Code: #include <iostream> using namespace std; int main() { cout<<"HEY, you, I'm alive! Oh, and Hello World!\n"; cin.get(); return 1; ...

  1. #1
    Registered User
    Join Date
    Aug 2009
    Posts
    36

    Compiler Issue

    Code:
     #include <iostream>
    
    using namespace std;
    
    int main()
    {
      cout<<"HEY, you, I'm alive! Oh, and Hello World!\n";
      cin.get();
    
      return 1;
    }

    That's the code I put in there(Yes its from the very first lesson :P )

    And I get this error when I try to build and run it..
    "Jesses C++ - Debug" uses an invalid compiler. Skipping...
    Nothing to be done.
    Can someone help me out?..

  2. #2
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,260
    What command are you doing to compile this?
    bit∙hub [bit-huhb] n. A source and destination for information.

  3. #3
    Registered User
    Join Date
    Aug 2009
    Posts
    36
    I tell it to "Build" and it gives me that error.

  4. #4
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,260
    In that case, what compiler are you using (or attempting to use)? My best guess right now is that you are using an IDE without selecting a compiler for it to use.
    bit∙hub [bit-huhb] n. A source and destination for information.

  5. #5
    Registered User
    Join Date
    Aug 2009
    Posts
    36
    I'm used CodeBlocks. It worked for me before and I got a new computer and this happened.

    How do I fix it? .

  6. #6
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,185
    Quote Originally Posted by Jesse20ghet View Post
    I'm used CodeBlocks. It worked for me before and I got a new computer and this happened.

    How do I fix it? .
    Did you get Code::Blocks with compiler or Code::Blocks without compiler? If the latter, you will need to have a compiler (since Code::Blocks isn't, itself, a compiler).

  7. #7
    Registered User
    Join Date
    Dec 2006
    Location
    Canada
    Posts
    3,183
    BTW, returning anything other than 0 from main means error. It's a way for programs to inform the OS that something went wrong.

  8. #8
    Registered User
    Join Date
    Aug 2009
    Posts
    36
    Yeah I got the compiler I'm sure.

    Yeah cyber thanks :P. Its just in the tutorial .

  9. #9
    Registered User
    Join Date
    Dec 2006
    Location
    Canada
    Posts
    3,183
    Yeah cyber thanks :P. Its just in the tutorial .
    Really? Are you sure it's not return 0? Which tutorial are you following?

  10. #10
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,185
    Settings -> Compiler and Debugger...

    At the very top is "Selected Compiler". Make sure it matches the compiler you have.

  11. #11
    Registered User
    Join Date
    Aug 2009
    Posts
    36
    How do I know if it matches my compiler or not?

  12. #12
    Registered User
    Join Date
    Apr 2008
    Posts
    890
    Ugh. For such a simple example, why bother with an IDE at all? Learn how to run the compiler on the command line and/or use a makefile. You can use an IDE when you start building more complex programs, but for learning exercises like this they just get in the way, and maybe even make it harder to learn.

  13. #13
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,185
    Quote Originally Posted by Jesse20ghet View Post
    How do I know if it matches my compiler or not?
    Surely you should know what compiler you have....

  14. #14
    Registered User
    Join Date
    Aug 2009
    Posts
    36
    i have Code Blocks..

  15. #15
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,185
    Quote Originally Posted by Jesse20ghet View Post
    i have Code Blocks..
    And I have a cardboard box. Neither of them are compilers.

    If you got the Code::Blocks + MinGW package, then you have gcc. (Look for a MinGW directory under C:\, assuming Windows). If you just got Code::Blocks, then you need to acquire a compiler separately.

Page 1 of 3 123 LastLast
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Dev C++ Compiler, Indentation?
    By Zeusbwr in forum C++ Programming
    Replies: 3
    Last Post: 10-21-2004, 07:13 AM
  2. lcc win32 compiler download problems
    By GanglyLamb in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 08-01-2004, 08:39 PM
  3. MSVC++ vs GCC compiler issue
    By WDT in forum C++ Programming
    Replies: 9
    Last Post: 01-04-2004, 01:07 PM
  4. Special Compiler for win app's
    By Unregistered in forum Windows Programming
    Replies: 19
    Last Post: 04-26-2002, 04:52 PM
  5. Compiler Issue
    By spd_dmn in forum C++ Programming
    Replies: 5
    Last Post: 01-16-2002, 01:29 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21