delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1997/07/09/19:08:41

From: weiku AT UTKUX1 DOT UTK DOT EDU ("Wei Ku")
Subject: Re: ld problem with templates
9 Jul 1997 19:08:41 -0700 :
Approved: cygnus DOT gnu-win32 AT cygnus DOT com
Distribution: cygnus
Message-ID: <199707091951.PAA28150.cygnus.gnu-win32@solid.ssd.ornl.gov>
Mime-Version: 1.0
X-Mailer: Microsoft Outlook Express 4.71.0544.0
Original-To: <gnu-win32 AT cygnus DOT com>
X-Priority: 3
X-MSMail-Priority: Normal
X-MimeOLE: Produced By Microsoft MimeOLE Engine V4.71.0544.0
Original-Sender: owner-gnu-win32 AT cygnus DOT com

This is a multi-part message in MIME format.

------=_NextPart_000_01BC8C7F.C92AECA0
Content-Type: text/plain;
	charset="US-ASCII"
Content-Transfer-Encoding: quoted-printable

I have not tried the stl yet but I will try. My suggestion is to use g++ =
instead of gcc. With g++, the libraries you used (lstdc++, g++) are =
linked by default, so you do not need to use option '-l' to link them. I =
hope this can solve your 'multiple definition' problem. eg, tye the =
following simple command:
g++ -c xx.cc

g++ -o xx.exe xx.o ...
Sincerely,
Wei Ku

***************************************
Department of Physics and Astronomy
The University of Tennessee
1408 Circle Drive
Knoxville, Tennessee 37996-1200
weiku AT utkux DOT utcc DOT utk DOT edu
---------------------------------------
Solid State Division
Oak Ridge National Laboratory
P.O.Box 2008
Oak Ridge, TN 37831-6032
Phone: (423) 574-5795
Fax: (423) 574-4143
weiku AT solid DOT ssd DOT ornl DOT gov
***************************************


 ----
From: Sylvio Triebel <Sylvio DOT Triebel AT inf-technik DOT tu-ilmenau DOT de>
To: gnu-win32 AT cygnus DOT com
Date: Wednesday, July 09, 1997 3:13 PM
Subject: ld problem with templates

dear sirs,
I tried to compile a program that uses stl extensivly.
There is no problem to compile it with  gnu 2.7.2 under solaris, linux
and OS/2.
Using gnuwin32 causes hundreds of linker errors like this:
.... multiple definition of __default_alloc_template<false,0>::...

(all errors occured contain '__default_alloc_template<false,0>::' !)

Is it a known problem? Should I use other ld options?

options to compile cc files were :
gcc -c xx.cc

options to link the executable were :
gcc -o xx.exe xx.o ... -lstdc++ -lg++ -lm


thanks
S. Triebel
--

--------------------------------------------------------------------
|######........|                         |                           |
|######........| Sylvio Triebel          | Tel.: +49 (0)3677 69 1171 |
|..##..........| TU Ilmenau              |              oder 69 1168 |
|..##.##.##....| PSF 327, 98693 Ilmenau  | FAX : +49 (0)3677 69 1163 |
|.....##.##....|                         |                           |
|.....#####.##.|-----------------------------------------------------|
|.....#####.##.|                                                     |
|...........##.| E-Mail: silvio AT inf-technik DOT tu-ilmenau DOT de            |
|...........##.|                                                     |
--------------------------------------------------------------------
-
For help on using this list (especially unsubscribing), send a message =
to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".


------=_NextPart_000_01BC8C7F.C92AECA0
Content-Type: text/html;
	charset="US-ASCII"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML 3.2//EN">
<HTML>
<HEAD>
<META content=3Dtext/html;charset=3Diso-8859-1 =
http-equiv=3DContent-Type>
<HTML><META content=3D'"Trident 4.71.0544.0"' name=3DGENERATOR>

</HEAD>
<BODY><FONT face=3DArial size=3D2><FONT size=3D2>
<P><FONT face=3DArial size=3D2><FONT size=3D2>I have not tried the stl =
yet but I will=20
try. My suggestion is to use g++ instead of gcc. With g++, the libraries =
you=20
used (lstdc++, g++) are linked by default, so you do not need to use =
option '-l'=20
to link them. I hope this can solve your 'multiple definition' problem. =
eg, tye=20
the following simple command:</FONT></FONT></P>

<P><FONT face=3DArial size=3D2><FONT size=3D2>g++ -c xx.cc<BR>
<BR>
g++ -o xx.exe xx.o ...</FONT></FONT></P>

<P>Sincerely,<BR>
Wei Ku<BR>
<BR>
***************************************<BR>
Department of Physics and Astronomy<BR>
The University of Tennessee<BR>
1408 Circle Drive<BR>
Knoxville, Tennessee 37996-1200<BR>
<A =
href=3D"mailto:weiku AT utkux DOT utcc DOT utk DOT edu">weiku AT utkux DOT utcc DOT utk DOT edu</A><BR>=

---------------------------------------<BR>
Solid State Division<BR>
Oak Ridge National Laboratory<BR>
P.O.Box 2008<BR>
Oak Ridge, TN 37831-6032<BR>
Phone: (423) 574-5795<BR>
Fax: (423) 574-4143<BR>
<A =
href=3D"mailto:weiku AT solid DOT ssd DOT ornl DOT gov">weiku AT solid DOT ssd DOT ornl DOT gov</A><BR>=

***************************************<BR>

</FONT>
<P>&nbsp;</P>
 ----<BR>
<B>From: </B>Sylvio Triebel =
&lt;Sylvio DOT Triebel AT inf-technik DOT tu-ilmenau DOT de&gt;<BR>
<B>To: </B>gnu-win32 AT cygnus DOT com<BR>
<B>Date: </B>Wednesday, July 09, 1997 3:13 PM<BR>
<B>Subject: </B>ld problem with templates<BR>
<BR>
<HTML><BODY><FONT size=3D2>dear sirs,<BR>
I tried to compile a program that uses stl extensivly.<BR>
There is no problem to compile it with&nbsp; gnu 2.7.2 under solaris, =
linux<BR>
and OS/2.<BR>
Using gnuwin32 causes hundreds of linker errors like this:<BR>
.... multiple definition of =
__default_alloc_template&lt;false,0&gt;::...<BR>
<BR>
(all errors occured contain '__default_alloc_template&lt;false,0&gt;::' =
!)<BR>
<BR>
Is it a known problem? Should I use other ld options?<BR>
<BR>
options to compile cc files were :<BR>
gcc -c xx.cc<BR>
<BR>
options to link the executable were :<BR>
gcc -o xx.exe xx.o ... -lstdc++ -lg++ -lm<BR>
<BR>
<BR>
thanks<BR>
S. Triebel<BR>
--<BR>
<BR>
--------------------------------------------------------------------<BR>
|######........|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;=20
|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;=20
|<BR>
|######........| Sylvio=20
Triebel&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | Tel.: =
+49=20
(0)3677 69 1171 |<BR>
|..##..........| TU=20
Ilmenau&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;=20
|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;=20
oder 69 1168 |<BR>
|..##.##.##....| PSF 327, 98693 Ilmenau&nbsp; | FAX : +49 (0)3677 69 =
1163 |<BR>
|.....##.##....|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;=20
|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;=20
|<BR>
|.....#####.##.|-----------------------------------------------------|<BR=
>
|.....#####.##.|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
|<BR>
|...........##.| E-Mail: <A=20
href=3D"mailto:silvio AT inf-technik DOT tu-ilmenau DOT de">silvio AT inf-technik DOT tu-il=
menau.de</A>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;=20
|<BR>
|...........##.|&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
|<BR>
--------------------------------------------------------------------<BR>
-<BR>
For help on using this list (especially unsubscribing), send a message =
to<BR>
&quot;<A=20
href=3D"mailto:gnu-win32-request AT cygnus DOT com">gnu-win32-request AT cygnus DOT com=
</A>&quot;=20
with one line of text: &quot;help&quot;.<BR>
</FONT></FONT>
</BODY></HTML>

------=_NextPart_000_01BC8C7F.C92AECA0--

-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019