Bug 22805 – [Reg 2.099] missing libraries when using some windows API calls with -m32

Status
NEW
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2022-02-21T23:24:35Z
Last change time
2024-12-13T19:21:06Z
Assigned to
No Owner
Creator
Rainer Schuetze
Moved to GitHub: dmd#20058 →

Comments

Comment #0 by r.sagitario — 2022-02-21T23:24:35Z
Not a big issue, but compiling and linking this file: module win; import core.sys.windows.windows; void main() { MessageBoxA(null, "hi", "there", MB_OK); } with > dmd -m32 win.d used to work, but after the change to COFF by default, it produces win.obj : error LNK2019: unresolved external symbol _MessageBoxA@16 referenced in function __Dmain win.exe : fatal error LNK1120: 1 unresolved externals This is caused by not specifiying the library user32.lib on the command line. In contrast, invoking optlink automatically adds it (and kernel32.lib). Maybe the same should be done for COFF to avoid breaking existing build scripts.
Comment #1 by robert.schadek — 2024-12-13T19:21:06Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/20058 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB