On Thursday, 8 March 2018 at 17:03:18 UTC, Robert M. Münch wrote:
Using Dub and pretty simple setup, that links in 3 C/C++ static
libraries, I get these linker errors:
libyogacore.lib(Yoga.obj) : error LNK2019: unresolved external
symbol __imp_fmodf referenced in function "void __cdecl
YGRoundToPixelGrid(struct YGNode * const,float,float,float)"
(?YGRoundToPixelGrid@@YAXQEAUYGNode@@MMM@Z)
libyogacore.lib(Yoga.obj) : error LNK2019: unresolved external
symbol __imp__CrtDbgReportW referenced in function "void *
__cdecl std::_Allocate_manually_vector_aligned<struct
std::_Default_allocate_traits>(unsigned __int64)"
(??$_Allocate_manually_vector_aligned@U_Default_allocate_traits@std@@@std@@YAPEAX_K@Z)
The first I don't understand as it should be in some run-time
libraries. The second indicates a problem with debug /
non-debug runtime libraries. However, I would expect that the
correct run-time libraries are used.
I'm building my code with just: dub build --arch=x86_64
Any idea?
By the looks of it, the C(++) libs have been compiled with /MDd
(debug DLL version of MSVC runtime libs), while DMD and LDC
default to the static (release) libs, i.e., /MT. The according
switch for DMD/LDC is `-mscrtlib` IIRC.