This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: gcc won't compile
- From: Claudio Bley <bley at cs dot uni-magdeburg dot de>
- To: Gabi Bakray <gabi at hadassah dot org dot il>
- Cc: "gcc-help at gcc dot gnu dot org" <gcc-help at gcc dot gnu dot org>
- Date: Tue, 27 Nov 2001 20:29:23 +0100
- Subject: Re: gcc won't compile
- References: <3C03D3F2.DFE24F48@hadassah.org.il>
>>>>> "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