Thread: Compiling C++

  1. #1
    Registered User
    Join Date
    Jan 2003
    Posts
    2

    same problem

    I have the same problem to im using a borland complier and it seem like something is wrong...I tried the extension .cpp and the others can i get some help plz....

  2. #2
    Two points-

    With your code the way it is I think you should use std and also leave spaces between things like the redirection operator and your cout.

    When you use std, either use-
    Code:
    #include <iostream>
    
    using namespace std;   //includes everything, cout, cin, endl 
    int main()
    {
        cout << "Hello.";
        return 0;
    }
    Code:
    #include <iostream>
    
    int main()
    {
        std::cout << "Hello.";
        return 0;
    }
    or
    Code:
    #include <iostream>
    
    using std::cout   //only allows to not use std::cout, doesn't include std::cin or std::endl 
    int main()
    {
        cout << "Hello.";
        return 0;
    }

  3. #3
    Registered User
    Join Date
    Nov 2002
    Posts
    1,109
    you need a ; for this:
    Code:
    using std::cout;
    I think munkey had a typo.
    Also, leave the .h out of iostream. you will get warnings with newer compilers that it is antiquated.

    like xterria said, try using Dev-C++. It uses the mingw compiler (which can be found at www.mingw.org). Dev-C++ is also an IDE, so you do not need to use command line.

    I prefer Quincy2000 right now for an IDE (www.alstevens.com/quincy.html). Both are free, see which one you like. There are also other IDEs out there if you do not like either. (Just throwing out some suggestions for IDEs)

  4. #4
    Registered User
    Join Date
    Jan 2003
    Posts
    2
    ok thanx imma try the dev-C++ i just d/l it...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Newbie Compiling Problem
    By Deronius in forum C++ Programming
    Replies: 3
    Last Post: 06-15-2008, 11:23 AM
  2. Screwy Linker Error - VC2005
    By Tonto in forum C++ Programming
    Replies: 5
    Last Post: 06-19-2007, 02:39 PM
  3. Problem Compiling
    By Flakster in forum C++ Programming
    Replies: 4
    Last Post: 06-13-2006, 01:09 AM
  4. compiling and executing issue with lcc win32
    By GanglyLamb in forum C Programming
    Replies: 10
    Last Post: 12-22-2004, 02:24 PM
  5. Compiling syntax
    By Jez_Master in forum C++ Programming
    Replies: 3
    Last Post: 04-01-2002, 09:46 PM