Linking with a c library on windows with ldc
MrSmith via digitalmars-d-ldc
digitalmars-d-ldc at puremagic.com
Fri Apr 8 07:54:04 PDT 2016
On Friday, 8 April 2016 at 13:40:25 UTC, kink wrote:
> On Thursday, 7 April 2016 at 22:12:57 UTC, MrSmith wrote:
>> I can see only 'Common Tools for Visul C++ 2015'. And it is
>> already installed.
>
> That's it. So what's your error when invoking ldc2 directly? If
> that works, it's a dub issue. We keep on getting dub bug
> reports here at LDC, so please report the bugs there if it's
> only dub related.
Here is it:
Using Visual Studio: C:\Program Files (x86)\Microsoft Visual
Studio 14.0\
libvcruntime.lib(telemetry.obj) : error LNK2005:
__telemetry_main_invoke_trigger already defined in
vcruntime.lib(VCRUNTIME140.dll)
libvcruntime.lib(telemetry.obj) : error LNK2005:
__telemetry_main_return_trigger already defined in
vcruntime.lib(VCRUNTIME140.dll)
Creating library
.dub\build\server-debug-windows-x86_64-ldc_0-222E54A7458436A7C409135304314236\server.lib and object .dub\build\server-debug-windows-x86_64-ldc_0-222E54A7458436A7C409135304314236\server.exp
LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of
other libs; use /NODEFAULTLIB:library
LINK : warning LNK4098: defaultlib 'vcruntime.lib' conflicts with
use of other libs; use /NODEFAULTLIB:library
phobos2-ldc.lib(zutil.c.obj) : warning LNK4217: locally defined
symbol free imported in function zcfree
phobos2-ldc.lib(gzwrite.c.obj) : warning LNK4217: locally defined
symbol free imported in function gz_comp
phobos2-ldc.lib(gzlib.c.obj) : warning LNK4049: locally defined
symbol free imported
phobos2-ldc.lib(zutil.c.obj) : warning LNK4217: locally defined
symbol malloc imported in function zcalloc
phobos2-ldc.lib(gzwrite.c.obj) : warning LNK4217: locally defined
symbol malloc imported in function gz_init
phobos2-ldc.lib(gzlib.c.obj) : warning LNK4217: locally defined
symbol malloc imported in function _snprintf
phobos2-ldc.lib(gzwrite.c.obj) : warning LNK4217: locally defined
symbol __stdio_common_vsprintf imported in function vsnprintf
phobos2-ldc.lib(gzlib.c.obj) : warning LNK4049: locally defined
symbol __stdio_common_vsprintf imported
phobos2-ldc.lib(gzwrite.c.obj) : warning LNK4217: locally defined
symbol _errno imported in function gz_comp
druntime-ldc.lib(errno.c.obj) : warning LNK4049: locally defined
symbol _errno imported
phobos2-ldc.lib(gzwrite.c.obj) : warning LNK4217: locally defined
symbol strerror imported in function gz_comp
phobos2-ldc.lib(gzlib.c.obj) : warning LNK4217: locally defined
symbol _wopen imported in function gz_open
phobos2-ldc.lib(gzlib.c.obj) : warning LNK4217: locally defined
symbol _lseeki64 imported in function gz_open
OLDNAMES.lib(close.obi) : warning LNK4049: locally defined symbol
_close imported
OLDNAMES.lib(write.obi) : warning LNK4049: locally defined symbol
_write imported
OLDNAMES.lib(open.obi) : warning LNK4049: locally defined symbol
_open imported
phobos2-ldc.lib(gzwrite.c.obj) : error LNK2019: unresolved
external symbol __imp_close referenced in function gzclose_w
OLDNAMES.lib(close.obi) : error LNK2001: unresolved external
symbol __imp_close
phobos2-ldc.lib(gzwrite.c.obj) : error LNK2019: unresolved
external symbol __imp_write referenced in function gz_comp
OLDNAMES.lib(write.obi) : error LNK2001: unresolved external
symbol __imp_write
phobos2-ldc.lib(gzlib.c.obj) : error LNK2019: unresolved external
symbol __imp_wcstombs referenced in function gz_open
phobos2-ldc.lib(gzlib.c.obj) : error LNK2019: unresolved external
symbol __imp_open referenced in function gz_open
OLDNAMES.lib(open.obi) : error LNK2001: unresolved external
symbol __imp_open
.dub\build\server-debug-windows-x86_64-ldc_0-222E54A7458436A7C409135304314236\server.exe : fatal error LNK1120: 4 unresolved externals
Error: `C:\Windows\system32\cmd.exe /s /c
"D:\D\ldc2\bin\amd64.bat link.exe"` failed with status: 1120
FAIL
.dub\build\server-debug-windows-x86_64-ldc_0-222E54A7458436A7C409135304314236\ server executable
ldc2 failed with exit code 1120.
Full exception:
object.Exception at source\dub\compilers\compiler.d(278): ldc2
failed with exit code 1120.
More information about the digitalmars-d-ldc
mailing list