This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: gcc won't compile


>>>>> "Gabi" == Gabi Bakray <gabi@hadassah.org.il> writes:

    Gabi> Hi, I installed gcc3.0.1 SPARC/Solaris 8 binary freeware
    Gabi> package.

    Gabi> g++ compiles a "helo world" program just fine, but when I
    Gabi> try to run gcc I get a very long error message starting
    Gabi> with:

    Gabi> /var/tmp/ccY1oxXs.o: In function `main':
    Gabi> /var/tmp/ccY1oxXs.o(.text+0x1ac): undefined reference to
    Gabi> `std::cout' .  .  .

    Gabi> What's wrong?


    Gabi> Sincerely,

    Gabi> Gabi Barkay

Hi.

Generally, if you want to compile a C++ program, just use g++.

Albeit gcc will determine the language from the file extension
(e.g. .C .cpp .cc .c++ for C++) it will not link with the necessary
standard C++ library libstdc++ and hence it will usually fail.

Compiling C programs with gcc should work fine.


Claudio


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]