Compiling C++

This is a discussion on Compiling C++ within the C++ Programming forums, part of the General Programming Boards category; I have the same problem to im using a borland complier and it seem like something is wrong...I tried the ...

  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
    _ Munkey01's Avatar
    Join Date
    Dec 2002
    Posts
    280
    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, 12:23 PM
  2. Screwy Linker Error - VC2005
    By Tonto in forum C++ Programming
    Replies: 5
    Last Post: 06-19-2007, 03:39 PM
  3. Problem Compiling
    By Flakster in forum C++ Programming
    Replies: 4
    Last Post: 06-13-2006, 02: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

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