Library object name collision

frame frame86 at live.com
Tue Jan 24 07:59:12 UTC 2023


When creating a linker library under Windows and having module 
a/b/foo.d but also d/c/foo.d the linker afterwards is bailing out:

> .lib(foo.obj) : warning LNK4255: library contain multiple 
> objects of the same name; linking object as if no debug info

And when I did inspect the library it confirmed that the compiler 
just places the objects twice - contents looks like this:

```
1.txt
1.types.obj
2.txt
2.types.obj
...
foo.obj
foo_1b34_260.obj
foo.obj
foo_1b44_991.obj
...
```
Which seems incorrect to me.

Does the compiler use an external command to create the library 
or does it itself?

Also why have most objects an unique postfix in the name but 
those files havn't? It's mostly a `__ModuleInfoZ` or `__initZ` 
but not always.

How to deal with this? I could rename the files but can't do that 
without changing the module name too which sucks.


More information about the Digitalmars-d-learn mailing list