Hi,
I am having trouble getting the testsuite project to compile... Here is what I have done so far:
++Check out latest version of quantlib
++Open dsw in VS2002; auto convert workspace/projects to new VS2002 format
++Build OnTheEdgeDebug all projects - Quantlib and 4 examples go fine, testsuite fails (details below)
Cppunit:
My installation for cppunit is:
++download v1.8.0 tarball
++open dsw in VS2002; autoconvert
++Batch build all configs - only 4 out of 9 configs complete, but cppunit.lib and cppunitd.lib appear in the lib directory...
++Add cppunit lib and include dirs to my VS2002 default include and lib directory list
Here's the error message that I get when trying to build testsuite:
(actually the linker error using /VERBOSE:LIB)
Linking...
Searching libraries
Searching C:\dev\cppunit\cppunit-1.8.0\lib\cppunitd.lib:
Searching C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\lib\odbc32.lib:
<SNIP,SNIP>
Searching \src\vendor\QL-current\QuantLib\lib\Win32\VisualStudio\QuantLib_d.lib:
Searching \dev\cppunit\cppunit-1.8.0\lib\cppunitd.lib:
Searching C:\Program Files\Microsoft Visual Studio .NET\Vc7\lib\libcpmtd.lib:
Searching C:\Program Files\Microsoft Visual Studio .NET\Vc7\lib\LIBCMTD.lib:
Searching C:\Program Files\Microsoft Visual Studio .NET\Vc7\lib\OLDNAMES.lib:
Searching C:\Program Files\Microsoft Visual Studio .NET\Vc7\lib\msvcprtd.lib:
msvcprtd.lib(MSVCP70D.dll) : error LNK2005: "public: __thiscall std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >(void)" (??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ) already defined in calendars.obj
<SNIP,SNIP - about 15 more similar errors>
MSVCRTD.lib(MSVCR70D.dll) : error LNK2005: "public: char const * __thiscall type_info::name(void)const " (?name@type_info@@QBEPBDXZ) already defined in LIBCMTD.lib(typname.obj)
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 LIBCMTD.lib(typinfo.obj)
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)
Searching C:\dev\cppunit\cppunit-1.8.0\lib\cppunitd.lib:
<SNIP,SNIP>
Searching \src\vendor\QL-current\QuantLib\lib\Win32\VisualStudio\QuantLib_d.lib:
Searching \dev\cppunit\cppunit-1.8.0\lib\cppunitd.lib:
Searching C:\Program Files\Microsoft Visual Studio .NET\Vc7\lib\libcpmtd.lib:
Searching C:\Program Files\Microsoft Visual Studio .NET\Vc7\lib\LIBCMTD.lib:
Searching C:\Program Files\Microsoft Visual Studio .NET\Vc7\lib\OLDNAMES.lib:
Searching C:\Program Files\Microsoft Visual Studio .NET\Vc7\lib\msvcprtd.lib:
Searching C:\Program Files\Microsoft Visual Studio .NET\Vc7\lib\MSVCRTD.lib:
Searching C:\dev\cppunit\cppunit-1.8.0\lib\cppunitd.lib:
Searching C:\Program Files\Microsoft Visual Studio .NET\Vc7\Platf
ormSDK\lib\odbc32.lib:
Searching C:\Program Files\Microsoft Visual Studio .NET\Vc7\PlatformSDK\lib\odbccp32.lib:
Finished searching libraries
LINK : warning LNK4098: defaultlib 'MSVCRTD' conflicts with use of other libs; use /NODEFAULTLIB:library
.\build\OnTheEdgeDebug/testsuite.exe : fatal error LNK1169: one or more multiply defined symbols found
------------------------------------------------------------------------------------------------------------------------
I can't tell you how much I hate tracking down these multiple def issues... But my obvious thought was that the cppunit lib's were linking to some incompatible runtime lib, but looking a the cppunit project files things looked correct (could be wrong though...). My next suspicion was the redef errors had to do with std::string and rtti so maybe this is some quirk of MSVC's silly template support, but that's really just a stab in the dark.
Incidentally I tried building both cppunit and quantlib in VC6 - for cppunit all 9 configs succeeded, but testsuite still had similar linker errors to what's above. (also there are a few compiler warnings that VC7 emits but vc6 does not)
Anyone have thoughts on things I could try to track this problem down?
Thanks, nehal
Free forum by Nabble | Edit this page |