I'm trying to use a 3rd party driver from an app in Qt Creator. This app has to be included as a static library. It won't compile without the /MT
flags. After much heartache, I've gotten it down to two linker errors:
msvcrtd.lib(ti_inst.obj):-1: error: LNK2005: "private: __thiscall type_info::type_info(class type_info const &)" (??0type_info@@AAE@ABV0@@Z) already defined in LIBCMTD.lib(typinfo.obj)
msvcrtd.lib(ti_inst.obj):-1: error: LNK2005: "private: class type_info & __thiscall type_info::operator=(class type_info const &)" (??4type_info@@AAEAAV0@ABV0@@Z) already defined in LIBCMTD.lib(typinfo.obj)
I think this problem is described here. If that's the case, then I suppose I need to know how to force Qt Creator to link these system libraries in a specific order, when I haven't even included them explicitly in the .pro file in the first place. If someone could tell me how to do that, that'd be great. If, however, this isn't the same problem described on the MS page, an explanation of what I'm really doing wrong, would be even better.
Just to get this marked as answered, I'll quote kanders84152: "Never mind. I was linking against the wrong msvc library. Supposed to use msvcmrt.lib
and not msvcurt.lib
nor msvcprt.lib
. It seems to work now. Thanks, all."