RE: [Boost-users] boost 1.30 / date_time / link problem with VC7
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.
On Mon, 10 May 2004 15:41:54 +0100, Ben Hutchings wrote
...
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.
For whatever reason it didn't hit me before that he is using boost 1.30. I don't think the error you are seeing is this *yet*, but he dynamic library stuff doesn't work correctly in 1.30 (symbols not exported correctly). So I recommend shifting to the static library version of the library. Jeff
participants (2)
-
Ben Hutchings
-
Jeff Garland