On Thursday, 1 October 2020 at 20:03:19 UTC, WhatMeWorry wrote:
Yes, but shouldn't the /NOENTRY option take care of that. Say, I just want to make a DLL of simple functions.
Your little example has 2 problems, the first being an incompatible extern(D) ex/import (mydll.myAddSeven vs. user.myAddSeven) and the second being an incomplete/wrong linker cmdline. When changing the myAddSeven declarations to extern(C++) (another option being a mydll.di header for the import), it works with
dmd -m64 -shared -L/NOENTRY mydll.d dmd -m64 user.d mydll.lib
For more details, see also https://wiki.dlang.org/Win32_DLLs_in_D.