I'm having the following problem when linking a MSWindows MFC application with the static library libboost_date_time.lib using DevStudio .Net 7.0.
The output looks like this:
------ Build started: Project: Main, Configuration: Debug Win32 ------ Linking... MSVCRTD.lib(ti_inst.obj) : error LNK2005: "private: __thiscall type_info::type_info(class type_info const &)" (??0type_info@@AAE@ABV0@@Z) already defined in
Dan Dimerman
MSVCRTD.lib(ti_inst.obj) : 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) LINK : warning LNK4098: defaultlib 'MSVCRTD' conflicts with use of other libs; use /NODEFAULTLIB:library Debug/Main.exe : fatal error LNK1169: one or more multiply defined symbols found
I am working with the "Multi-threaded Debug (/MTd)" version of libraries. Tried using alternatives, but I got errors elsewhere and the errors above persisted. From boost, I am using the library built at "My Documents\Visual Studio Projects\boost\libs\date_time\build\bin\libboost_date_time.lib \vc7\debug\runtime-link-dynamic"
Any help will be greatly appreciated...
You are using the debug DLL version of the date_time library. In order to share a heap with the main program this uses the debug DLL version of the C++ run-time library (MSVCRTD) and requires that the main program uses it too. You must either: (1) Build and use the debug multi-threaded static version of the date_time library. (2) Use the debug DLL versions of the C++ run-time library and MFC in your main program.