On 07/06/2026 11:09 AM, Alexander wrote:
So I added
```
"dflags": ["-L/SUBSYSTEM:WINDOWS", "-L/ENTRY:wWinMainCRTStartup"],
```
to `dub.json`, implemented `wWinMain()` as described at [D for Win32] (https://wiki.dlang.org/D_for_Win32) (I think this needs to be updated for Unicode version, it's no sense to use non-Unicode if you are not programming for Windows 98) and everything was fine until I removed old `main()` function when decided the new one is good enough. After that seems linker just decided to drop all default dependencies including D runtime itself and I got a lot of `unresolved external` errors. It took me some time to figure out what caused this. Is this linker behavior intentional? Now I have empty `main()` function to be able to build the app.

This may not be the linkers fault.

main, WinMain, and DllMain are all recognized by dmd as entry points.

It does not appear to support wWinMain, and that would be a bug.

  • Windows: SUBSYST... Alexander via Digitalmars-d-learn
    • Re: Windows... Richard (Rikki) Andrew Cattermole via Digitalmars-d-learn
    • Re: Windows... Adam D. Ruppe via Digitalmars-d-learn

Reply via email to