Windows: strange linker error "fatal error LNK1377"

Alexander roland.taverner at gmail.com
Wed Jun 10 14:53:43 UTC 2026


On Wednesday, 10 June 2026 at 13:13:28 UTC, kinke wrote:
> On Tuesday, 9 June 2026 at 21:01:10 UTC, Alexander wrote:
>> Is this a bug?
>
> No, this happens when you don't link the static library 
> defining the struct. And the static init symbol for that struct 
> (defined in the static lib) is needed because it's not 
> zero-initialized, due to the static `wchar` arrays. druntime 
> initializes them with 0 for its definition of the 
> `NOTIFYICONDATAW` struct: 
> https://github.com/dlang/dmd/blob/940287bf502969bdb3150946f1c9c402faef0880/druntime/src/core/sys/windows/shellapi.d#L232-L256; it's still not zero-initialized though, because druntime initializes the `cbSize` member.

I link the static library. It passed to linker as
```
/DEFAULTLIB:"C:\Users\Alexander\AppData\Local\dub\cache\windows-d\~master\+windows\build\library-debug-_NZe8fN0M5GyMbh5vcPwPA\windows.lib"
```
This lib added as dependency in dub.json
```
"dependencies": {
   "argsd": "~>1.2.0",
   "vibe-d": "~>0.9",
   "prometheus:vibe": "~>0.2.1",
   "windows-d:windows": {
     "path": "../windows-d"
   }
}
```


More information about the Digitalmars-d-learn mailing list