This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: win32 dlls and template instanciations


On Mon, 2007-07-02 at 16:17 +0200, Mathieu Lacage wrote:
> I thus tried to re-compile my program with -fno-implicit-templates but
> this did not eliminate template instanciation: the dll and the main
> binary still contain a copy of the template. Is there something special
> I should know about this option ?

That option must be used with -fno-implicit-inline-templates in my case
but, as pointed out elsewhere, this was really a gcc problem, not a
linker problem.

> If I could make this option work, I would still need to make my main
> binary import all template instances. Danny Smith helpfully suggested
> the following syntax to perform explicit template instanciation import: 
> 
> + // Import rather than instantiate
> + extern template class __declspec (dllimport) Test <0>;
> 
> But I cannot imagine myself having to import all potential template
> instanciations by hand: is there a way to tell ld to automatically
> import all the templates it does not instanciate ?

and playing a bit with this once I solved the problem above shows that
the toolchain's default behavior is to actually import all
non-instantiated templates. So, the question was moot.

sorry about the noise,
Mathieu


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