On Friday, 18 July 2025 at 15:25:04 UTC, Kagamin wrote:
> ldc has libs in lib/mingw
Please help me how to use it.
Currently I managed to compile a very simple example, after installing win10 sdk:
I was happy that I don't even need to pass
--m64
--line-internally
Because it was defaulted.
I only passed -L/subsystem:windowed
import core.sys.windows.windows;
import core.sys.windows.winuser;
extern (Windows)
int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) {
MessageBoxA(null, "Hello, Win32!", "D Language", MB_OK);
return 0;
}
Compiled with:
ldc2 win32_app.d -L/subsystem:windows
Simple and effective.
But with a 40k project it fails at the very end with:
lld-link: error: could not open 'libcmt.lib': no such file or directory
lld-link: error: could not open 'LIBCMT.lib': no such file or directory
Error: linking with LLD failed
I also asked Deepseek, how to use that mingw and it said I need gcc.
But I have LDC2 with an internal linker.
What is this libcmt problem?
I only found the word libcmt in a 5 year old comment, that's not an actual pragma(lib) made by me.