End Google Ads 201810 - BS.net 01 --> I'm trying to put reusable code into a static library and link it into a couple of different projects.

The problem is that while linking one of the projects that's supposed to use the reusable code, it reports all sorts of multiply defined symbols. (See below)

The main projects use DLL versions of the C-runtime, and the static library is set to use the multi-threaded dll version also.

What's the trick to successfully linking a static library into multiple projects?
(If I haven't provided enough info, just ask.)

Multiply defined symbols messages:
(Is this happening because the C-runtime is linked into the static lib first, and then those symbols are conflicting with the symbols in the main project?)
5>LIBCMTD.lib(dbgheap.obj) : error LNK2005: __CrtSetCheckCount already defined in msvcrtd.lib(MSVCR120D.dll)5>LIBCMTD.lib(dbgheap.obj) : error LNK2005: __calloc_dbg already defined in msvcrtd.lib(MSVCR120D.dll)5>LIBCMTD.lib(invarg.obj) : error LNK2005: __invoke_watson already defined in msvcrtd.lib(MSVCR120D.dll)5>LIBCMTD.lib(sprintf.obj) : error LNK2005: _sprintf already defined in msvcrtd.lib(MSVCR120D.dll)5>LIBCMTD.lib(dbghook.obj) : error LNK2005: __crt_debugger_hook already defined in msvcrtd.lib(MSVCR120D.dll)5>LIBCMTD.lib(crt0dat.obj) : error LNK2005: __amsg_exit already defined in msvcrtd.lib(MSVCR120D.dll)5>LIBCMTD.lib(crt0dat.obj) : error LNK2005: __cexit already defined in msvcrtd.lib(MSVCR120D.dll)5>LIBCMTD.lib(crt0dat.obj) : error LNK2005: __exit already defined in msvcrtd.lib(MSVCR120D.dll)5>LIBCMTD.lib(crt0dat.obj) : error LNK2005: __initterm_e already defined in msvcrtd.lib(MSVCR120D.dll)5>LIBCMTD.lib(crt0dat.obj) : error LNK2005: _exit already defined in msvcrtd.lib(MSVCR120D.dll)5>LIBCMTD.lib(wsetloca.obj) : error LNK2005: __configthreadlocale already defined in msvcrtd.lib(MSVCR120D.dll)5>LIBCMTD.lib(swprintf.obj) : error LNK2005: _swprintf_s already defined in msvcrtd.lib(MSVCR120D.dll)5>LIBCMTD.lib(mlock.obj) : error LNK2005: __lock already defined in msvcrtd.lib(MSVCR120D.dll)5>LIBCMTD.lib(mlock.obj) : error LNK2005: __unlock already defined in msvcrtd.lib(MSVCR120D.dll)5>LIBCMTD.lib(winapisupp.obj) : error LNK2005: ___crtGetShowWindowMode already defined in msvcrtd.lib(MSVCR120D.dll)5>LIBCMTD.lib(winapisupp.obj) : error LNK2005: ___crtSetUnhandledExceptionFilter already defined in msvcrtd.lib(MSVCR120D.dll)5>LIBCMTD.lib(winapisupp.obj) : error LNK2005: ___crtTerminateProcess already defined in msvcrtd.lib(MSVCR120D.dll)5>LIBCMTD.lib(winapisupp.obj) : error LNK2005: ___crtUnhandledException already defined in msvcrtd.lib(MSVCR120D.dll)5>LIBCMTD.lib(winxfltr.obj) : error LNK2005: __XcptFilter already defined in msvcrtd.lib(MSVCR120D.dll)5>LIBCMTD.lib(vsnprnc.obj) : error LNK2005: __vsnprintf_s already defined in msvcrtd.lib(MSVCR120D.dll)5>LIBCMTD.lib(hooks.obj) : error LNK2005: "void __cdecl terminate(void)" (?terminate@@YAXXZ) already defined in msvcrtd.lib(MSVCR120D.dll)5>LIBCMTD.lib(crt0init.obj) : error LNK2005: ___xi_a already defined in msvcrtd.lib(cinitexe.obj)5>LIBCMTD.lib(crt0init.obj) : error LNK2005: ___xi_z already defined in msvcrtd.lib(cinitexe.obj)5>LIBCMTD.lib(crt0init.obj) : error LNK2005: ___xc_a already defined in msvcrtd.lib(cinitexe.obj)5>LIBCMTD.lib(crt0init.obj) : error LNK2005: ___xc_z already defined in msvcrtd.lib(cinitexe.obj)5>LIBCMTD.lib(vswprnc.obj) : error LNK2005: __vsnwprintf_s already defined in msvcrtd.lib(MSVCR120D.dll)5>LIBCMTD.lib(dbgrptw.obj) : error LNK2005: __CrtDbgReportW already defined in msvcrtd.lib(MSVCR120D.dll)5>LIBCMTD.lib(printf.obj) : error LNK2005: _printf already defined in msvcrtd.lib(MSVCR120D.dll)5>LIBCMTD.lib(errmode.obj) : error LNK2005: ___set_app_type already defined in msvcrtd.lib(MSVCR120D.dll)5>LIBCMTD.lib(towlower.obj) : error LNK2005: _towlower already defined in msvcrtd.lib(MSVCR120D.dll)5>LINK : warning LNK4098: defaultlib 'msvcrtd.lib' conflicts with use of other libs; use /NODEFAULTLIB:library5>LINK : warning LNK4098: defaultlib 'LIBCMTD' conflicts with use of other libs; use /NODEFAULTLIB:library


The difficult we do right away...
...the impossible takes slightly longer.