DMD - issue building shared library
Dibyendu Majumdar via Digitalmars-d
digitalmars-d at puremagic.com
Sun Jan 17 08:10:01 PST 2016
Hi
I have an existing C shared library that I am trying to link to a
D shared library. The D shared library at present only has a
binding (extern (C)) definition, nothing else.
When I try to create the shared library using the DMD command
line I get link errors.
Platform is Windows 10 64-bit.
The command I am using is:
dmd -m64 -shared -v -L/LIBPATH:c:\ravi\lib -Lravimatrix.lib
source\matrix.d
Partial output from DMD follows:
binary C:\D\dmd2\windows\bin\dmd.exe
version v2.069.2
config C:\D\dmd2\windows\bin\sc.ini
parse matrix
importall Dmatrix
import object
(C:\D\dmd2\windows\bin\..\..\src\druntime\import\object.d)
import std.stdint
(C:\D\dmd2\windows\bin\..\..\src\phobos\std\stdint.d)
import core.stdc.stdint
(C:\D\dmd2\windows\bin\..\..\src\druntime\import\core\stdc\stdint.d)
...
import core.stdc.string
(C:\D\dmd2\windows\bin\..\..\src\druntime\import\core\stdc\string.d)
semantic2 Dmatrix
semantic3 Dmatrix
code Dmatrix
C:\Program Files (x86)\Microsoft Visual Studio
14.0\VC\\bin\x86_amd64\link.exe /NOLOGO matrix /DLL
/LIBPATH:c:\ravi\lib ravimatrix.lib /OPT:NOICF
/LIBPATH:"C:\Program Files (x86)\Microsoft Visual Studio
14.0\VC\\lib\amd64" /LIBPATH:"C:\Program Files (x86)\Windows
Kits\8.1\\lib\x64" /LIBPATH:"C:\Program Files (x86)\Windows
Kits\10\\lib\10.0.10240.0\ucrt\x64" legacy_stdio_definitions.lib
matrix.obj : error LNK2001: unresolved external symbol
_D3std5stdio12__ModuleInfoZ
matrix.obj : error LNK2001: unresolved external symbol
_D15TypeInfo_Struct6__vtblZ
matrix.obj : error LNK2019: unresolved external symbol _d_assert
referenced in function _D7Dmatrix8__assertFiZv
matrix.obj : error LNK2019: unresolved external symbol
_d_unittest referenced in function _D7Dmatrix15__unittest_failFiZv
matrix.obj : error LNK2019: unresolved external symbol
_d_arraybounds referenced in function _D7Dmatrix7__arrayZ
LINK : error LNK2001: unresolved external symbol
_DllMainCRTStartup
matrix.dll : fatal error LNK1120: 6 unresolved externals
--- errorlevel 1120
More information about the Digitalmars-d
mailing list