This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Linking using egcs (-frepo question)
- To: mschaefer at dsai dot com (Mark Schaefer), egcs at cygnus dot com
- Subject: Re: Linking using egcs (-frepo question)
- From: Jason Merrill <jason at cygnus dot com>
- Date: 26 Nov 1997 01:17:44 -0800
- References: <97Nov20.151410mst.26889.cygnus.egcs@colorado.dsai.com>
>>>>> Mark Schaefer <mschaefer@dsai.com> writes:
> I have a program which uses template libraries. The problem is that I
> get undefined refrences because the ar utility doesn't instantiate the
> required template code. Gcc runs the collect2 program to instantiate the
> template code, but then complains about main(), which led me to believe
> that it can't generate static libraries. ar doesn't run collect2, which
> causes no end of undefined symbol messages.
When you create libraries, try to link all the objects together. It will
fail, but collect2 will instantiate the templates the library uses. When
you create subsequent libraries, be sure to include the earlier libraries
in your link line so that you don't get duplicates.
Jason