On 08.04.2013 20:54, Jacob Carlborg wrote:
On 2013-04-08 20:00, Rainer Schuetze wrote:
I think the correct way is to remove the C main function from dmain2.d
and put it in an extra library to be linked with the executable. At
least on Windows, you won't be able to link back from the DLL to the
main executable.
The D main function as well?
Inside a DLL you don't run the D main function, and the executable must
have it (or WinMain), so it doesn't make sense to define one in the
shared druntime DLL.
Depending on whether _Dmain, WinMain or DLLMain is found in the D source
code, the corresponding startup code is linked, and only the startup
code for _Dmain drags in the the C main function.