* Win32 issues with Templates and Libs *
kris
foo at bar.com
Tue Feb 20 20:00:25 PST 2007
kris wrote:
> Walter Bright wrote:
>
>> kris wrote:
>>
>>> Would you perhaps explain why ELF does not have this problem? Thanks
>>
>>
>>
>> The ar format doesn't care if there are multiple definitions of the
>> same symbol. The linker just picks one (presumably the first one it
>> finds) and pulls in that module along with whatever else happens to be
>> in that module.
>
>
> For whatever reason, that approach appears to work quite effectively?
>
> The problem here is that one cannot currently build a production quality
> lib where templates are involved. It's not reasonable or feasible to
> expect a user to understand and compensate for the issues involved, nor
> is it entirely feasible to construct the lib in such a manner that the
> rather delicate balance is maintained. We wish it were.
>
> The reality problem is this: the more extensive the lib, and the more
> use it makes of templates, the fragility of it appears to increase
> exponentially. As does the difficulty of reverting that fragility.
>
> At this time, it is just not possible for us to construct a reliable
> Tango.lib which, given our collective D 'expertise', seems entirely
> bogus :)
>
> Can you resolve it in some reliable and user-friendly manner?
>
For example, I get this when linking certain examples:
..\..\tango.lib(Socket)
Error 42: Symbol Undefined _D12TypeInfo_AAa6__initZ
--- errorlevel 1
Through a slow and entirely tedious process of 'playing' with the lib
contents (which took all day), I discover that removing a very specific
set of modules cause this link error to go away. Some of those modules
make reference to one of two IFTI modules.
With another module, I find that commenting out a single method
eliminates the linker error. There are no templates within this module,
but the particular method creates and returns an AA ...... arrgghhhh!
How can anyone deal with that kind of development environment and remain
sane? How could they possibly know how to resolve these? I ask you :)
Now it's onto the next example that refuses to link. I'm pretty sure it
is cold seawater I can feel around my ankles now
More information about the Digitalmars-d
mailing list