It seems that SimpleDllMain plays not well with static linked DLLs.
The trace is empty.
Tested under Windows 10 but same problem on Windows 7.
Doesn't matter if 32 or 64 bit.
This example would not need SimpleDllMain but other complex functions may require it.
// dmd -g -version=lib -L/IMPLIB -of=common.dll
version (lib)
{
import core.sys.windows.dll;
mixin SimpleDllMain;
export int test()
{
return 123;
}
}
else
{
import std.stdio;
pragma(lib, "common.lib");
extern int test();
void main()
{
assert(test() == 123);
try
{
throw new Exception("test");
}
catch (Throwable e)
{
const(char)[] lines;
foreach (n; e.info)
lines ~= n;
assert(lines.length > 0);
}
}
}
Comment #1 by robert.schadek — 2024-12-07T13:41:18Z