Trying to create a trivial 64 bit D Lang DLL on a Windows 10 machine and cant get past linking.
noone at nowhere.com
Thu Oct 1 20:28:58 UTC 2020
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
> 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.
More information about the Digitalmars-d-learn