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: using templates in shared library



> -frepo.  You do a full link with the two on the command line, and let
> it error out.  But as a side effect, it will instantiate everything
> just once.

Unless I misunderstood your procedure, this also doesn't work. Let me
state my problem again: I am building _two_ shared libraries and _no_
executables. Library 1 uses vector<int> and so does library 2. When I
build library 1, the default egcs options will result in vector<int>
being instantiated in library 1. Good. Then I build library 2 and
during the link phase, I tell it to link dynamically to library 1. 

It should be trivial for the linker to figure out that library 1
already has vector<int>. I want it to drop the instantiation of
vector<int> from library 2. 

The -frepo only seems to work if I have an executable too. I could
make a trivial demo that uses everything in library 1 and 2, but that
makes the compiler recompile the demo, not the library. 

Kasper


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