Compiling a program using C++ new/delete results in linker failures for DMD nightly (2026-09-08) for Windows using wine under Linux:
import core.stdcpp.new_;
extern(C++) class C
{
~this(){}
}
void main()
{
auto obj = cpp_new!C;
cpp_delete(obj);
}
Compiling it with wine dmd test.d legacy_stdio_definitions.lib results in:
Unrecognised C++ runtime library 'ucrtbase'
lld-link: error: undefined symbol: void * __cdecl operator new(unsigned __int64)
>>> referenced by test.obj:(_D4core6stdcpp4new___T7cpp_newTC4test1CZQsFNiZQp)
lld-link: error: undefined symbol: void __cdecl operator delete(void *)
>>> referenced by test.obj:(_D4core6stdcpp4new___T10cpp_deleteTC4test1CZQwFQmZv)
Error: linker exited with status 1
Z:\opt\dmd2-nightly-windows-2026-09-08\windows\bin64\lld-link.exe /NOLOGO "test.obj" /DEFAULTLIB:"legacy_stdio_definitions.li
b" /DEFAULTLIB:phobos64 vcruntime140.lib /LIBPATH:"Z:\opt\dmd2-nightly-windows-2026-09-08\windows\bin64\..\lib64\mingw"
The first output line is a pragma(msg) from druntime core/stdcpp/xutility.d.
I think this could be caused by PR #23345, but did not check.
Compiling a program using C++ new/delete results in linker failures for DMD nightly (2026-09-08) for Windows using wine under Linux:
Compiling it with
wine dmd test.d legacy_stdio_definitions.libresults in:The first output line is a
pragma(msg)from druntime core/stdcpp/xutility.d.I think this could be caused by PR #23345, but did not check.