How do I interface D to a C library based on a DLL?

Carlos Santander csantander619 at gmail.com
Wed Jun 13 09:41:57 PDT 2007


Christopher Grantham escribió:
> Interestingly, if I do this from the command line, I get this output:
> 
> K:\Projects\SoftwareDev\Learn D\OrcFxAPITest\src>dmd -run ./test.d 
> OrcFxAPI.d OrcFxAPI.lib
> OPTLINK (R) for Win32 Release 7.50B1
> Copyright (C) Digital Mars 1989 - 2001  All Rights Reserved
> 
> C:\dmd\bin\..\lib\phobos.lib(dmain2)
>  Error 42: Symbol Undefined _C_GetDLLVersion at 16
> --- errorLevel 1

This looks like Windows naming convention. Can you try using extern(C) instead 
of extern(Windows) wherever you define C_GetDLLVersion? Or you could examine the 
contents of the .lib (lib -l) and see what symbols are there.

-- 
Carlos Santander Bernal


More information about the Digitalmars-d-learn mailing list