C++ Compiler

This is a discussion on C++ Compiler within the Linux Programming forums, part of the Platform Specific Boards category; I use Linux 7.1 , and i can compile C and Java , but now i tried to compile C++ ...

  1. #1
    Registered User
    Join Date
    Dec 2001
    Posts
    7

    C++ Compiler

    I use Linux 7.1 , and i can compile C and Java , but now i tried to compile C++ and i got error massages.
    the program was
    #include<iostream.h> // or <iostream>
    void main(void)
    {cout << "hello\n";}
    i compiled with
    cc -o runningname file.cpp

    I think the error comes with the <iostream>,in the /usr/include directory i see all C header files but no iostream , but in YaST the GNU C++ Compiler is installed.

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,668
    You ran the C compiler
    Try
    g++ -o runningname file.cpp

  3. #3
    Registered User
    Join Date
    Dec 2001
    Posts
    7

    Smile

    Thanks , now its running !

  4. #4
    the hat of redundancy hat nvoigt's Avatar
    Join Date
    Aug 2001
    Location
    Hannover, Germany
    Posts
    3,139
    It's been some time, and it might vary from *nix to *nix, but when I last used one, the C compiler was cc while the C++ compiler was CC.
    hth
    -nv

    She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."

    When in doubt, read the FAQ.
    Then ask a smart question.

  5. #5
    31173 h4x0r gnu-ehacks's Avatar
    Join Date
    Nov 2001
    Posts
    556
    I think it depends on the distro...I think there was a gpp, g++, and gcc...I only saw gpp on 1 distro of Linux though.
    What will people say if they hear that I'm a Jesus freak?
    What will people do if they find that it's true?
    I don't really care if they label me a Jesus freak, there is no disguising the truth!

    Jesus Freak, D.C. Talk

    -gnu-ehacks

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, 05:42 AM
  4. how to call a compiler?
    By castlelight in forum C Programming
    Replies: 3
    Last Post: 11-22-2005, 10:28 AM
  5. Bad code or bad compiler?
    By musayume in forum C Programming
    Replies: 3
    Last Post: 10-22-2001, 09:08 PM

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