how to export callbacks on win64?

captaindet via digitalmars-d-ldc digitalmars-d-ldc at puremagic.com
Tue Oct 25 14:28:50 PDT 2016


i appreciate that you are trying to help. however, you are indicating 
workarounds for something that should work out of the box.

again, D has the export attribute for this reason
https://dlang.org/spec/attribute.html
and my code/use-case works fine with DMD (and the MS linker).

the lack of replies addressing the root problem seems to indicate that 
LDC does not respect the export attribute. maybe i should file a bug.

On 2016-10-26 01:10, Kagamin wrote:
 > You can also use the /export option:
 > https://msdn.microsoft.com/en-us/library/7k30y2k5.aspx

these workarounds don't work for me. with respect to the three methods 
given under 'remarks' (see your link):

 > 1. __declspec(dllexport) in the source code

as i understand it, this is what D's export attribute is supposed to 
trigger. but it does not seem to work with LDC.

 > 2. An EXPORTS statement in a .def file
 > 3. An /EXPORT specification in a LINK command

out of the question for my use-case. i got a large number of such 
callback functions and - and this is the real deal-breaker - they are 
generated and mixed in during CT. even if i could produce a .def file or 
linker commands during CT (which is currently not possible nor is it a 
desirable route to go), they would not be used for that compilation.

as it stands this is a blocker for me, meaning i cannot use LDC for my 
project.

/det


More information about the digitalmars-d-ldc mailing list