Subject: Re: gcc problem
From: "Gerrit P. Haase" <[email-masked]>
To: Lauer Rainer <[email-masked]>
Cc: "[email-masked]'" <[email-masked]>, "[email-masked]'" <[email-masked]>
Date: Tue, 2 Mar 2004 14:23:32 +0100

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/