This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Linking using egcs (-frepo question)


>>>>> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]