This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: gcc problem
- From: "Gerrit P. Haase" <freeweb at nyckelpiga dot de>
- To: Lauer Rainer <rainer dot lauer at thomson dot net>
- Cc: "'cygwin at cygwin dot com'" <cygwin at cygwin dot com>, "'lauerr at gmx dot net'" <lauerr at gmx dot net>
- Date: Tue, 2 Mar 2004 14:23:32 +0100
- Subject: Re: gcc problem
- Organization: Esse keine toten Tiere
- References: <0FFE4E4AF139D311A62C00508B0BE5E801EB9F09@exchange3.villingen.thmulti.com>
- Reply-to: "Gerrit P. Haase" <freeweb at nyckelpiga dot de>
Hello Rainer,
you wrote:
> I've installed the latest version of cygwin (as of today 2.03.04). My PC is
> running Windows 2000 with service pack 4. Installation is done on my loca
> drive d:. I tried a small "C++" and failed, the reason is totally unclear to
> me.
> The program is:
[...]
> The error message is:
> $ gcc -o gtest gtest.cc
> /cygdrive/c/DOCUME~1/lauerr/LOCALS~1/Temp/ccCmpxzX.o(.text+0x4d):gtest.cc:
> undefined reference to `std::ios_base::Init::Init[in-charge]()'
> /cygdrive/c/DOCUME~1/lauerr/LOCALS~1/Temp/ccCmpxzX.o(.text+0x68):gtest.cc:
> undefined reference to `std::ios_base::Init::~Init [in-charge]()'
> collect2: ld returned 1 exit status
g++ is in a separate package named gcc-g++, be sure you have installed
this too. Then you need to link against libstdc++ when using gcc as
driver:
gcc -o gtest gtest.cc -lstdc++
or you use g++ as driver which includes libstdc++ automatically:
g++ -o gtest gtest.cc
HTH,
Gerrit
--
=^..^= http://nyckelpiga.de/donate.html
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/