Thread: why gcc can't compile C++

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Registered User
    Join Date
    Aug 2010
    Posts
    3

    why gcc can't compile C++

    This problem was solved and this is a stupid question.

    But I leave my topic here hope this can helps some one.

    hi everyone, im new to programming. I only do web programming before.;

    i tried to compile those line of codes with gcc on my CentOS 5 server:

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

    I googled it and people said i should use g++ instead of gcc; Yeah that would be fine but WHY ?

    On this site GCC, the GNU Compiler Collection - GNU Project - Free Software Foundation (FSF) they said gcc can compile c++ as well, why i cannot use it?

    Please somebody let me know why, i will appreciate so much. I hate doing things that i dont know why. I will not use g++ to compile my *.cpp until i know why. Thank you.
    Last edited by namduong; 08-19-2010 at 06:56 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Compiling GNU MP
    By mattnp12 in forum C Programming
    Replies: 3
    Last Post: 06-23-2011, 03:58 PM
  2. Weird compile errors (gcc, pthread, math)
    By skytreader in forum C Programming
    Replies: 7
    Last Post: 07-20-2010, 11:33 AM
  3. Replies: 4
    Last Post: 09-02-2007, 08:47 PM
  4. Compile crashes certain windows
    By Loduwijk in forum C++ Programming
    Replies: 5
    Last Post: 03-26-2006, 09:05 PM
  5. Replies: 4
    Last Post: 11-14-2001, 10:28 AM