Subject: RE: Newbie template linking problem
From: [email-masked] (Berns, Brian)

18 Jun 1998 00:55:55 -0700
Message-ID: <c=US%a=_%p=NASD%l=[email-masked]>
To: "'Mumit Khan'" <[email-masked]>
Cc: "[email-masked]'" <[email-masked]>

Thanks.  I am now successfully using egcs to compile and link my C++
program.  My question now is: Should I be using the -frepo option?  When
I do, I get linker errors.  When I don't, everything links and runs
fine, but the resulting executable is quite large (esp. in comparison to
the corresponding .exe produced by VC++) -- I wonder if it contains
redundant template instantiations?  The archive info on this topic seems
somewhat muddled.  What's the current behavior?

-- Brian

-----Original Message-----
From: Mumit Khan [mailto:[email-masked]]
Sent: Wednesday, June 10, 1998 11:15 AM
To: Berns, Brian
Subject: Re: Newbie template linking problem

On Tue, 9 Jun 1998, Berns, Brian wrote:

> I am trying to compile the following trivial C++ program using Cygwin32
> Beta 19 on Windows NT 4.0:
> 
>    #include <string>
>    using namespace std;
> 
>    void main()
>    {
>       string s = "hello";
>    }
> 
> All my attempts are choking in the link phase:
> 
>    % g++ hello.cpp
>    [...]/libstdc++.a [...] multiple definition of `basic_string[...]'
>    [...]hello.cc: first defined here
> 

Update your compiler to egcs-1.0.2 which has no problem with this. See
http://www.xraylith.wisc.edu/~khan/software/gnu-win32/ for more info
on how downloading and installing egcs-1.0.2 for Cygwin32.

Mumit

-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".