dub, ldc2, MS VS 2015, static c library
dm via digitalmars-d-ldc
digitalmars-d-ldc at puremagic.com
Fri Dec 16 01:31:06 PST 2016
On Friday, 16 December 2016 at 08:35:06 UTC, Nicholas Wilson
> It looks like it still can't find your function.
> Whats the linker command being generated? Try running whatever
> the equivalent of `nm` is on windows on sl.obj and mylib.lib
> and see what the difference is?
dumpbin of mylib.lib: http://pastebin.com/VhxPGg0P
dumpbin of sl.obj: http://pastebin.com/10ns1yPV
Looks like both have "?myFunc@@YAHHH at Z"
> (generally try to check with dmd before posting to the ldc, as
> you're likely to get more and better help faster in learn. even
> if it ldc specific you're still likely to get a faster response
> if its something generic like linker error. Internal complier
> errors and the like post here or submit a bug report.)
Tried with dmd:
E:\D\sl>dub build --arch=x86_64 --build=release
Performing "release" build using dmd for x86_64.
sl ~master: building configuration "application"...
sl.obj : error LNK2019: unresolved external symbol "int __cdecl
myFunc(int,int)" (?myFunc@@YAHHH at Z) referenced in function _Dmain
.dub\build\application-release-windows-x86_64-dmd_2071-CD89D45874AE7C4F9D5C24A2CFF55DF4\sl.exe : fatal error LNK1120: 1 unresolved externals
--- errorlevel 1120
dmd failed with exit code 1120.
dumpbin of dmd's sl.obj: http://pastebin.com/8XP5Kz7Y
Seems it's also have "?myFunc@@YAHHH at Z"
More information about the digitalmars-d-ldc