Login  Register

Compiling under MSVC

Posted by Andre Louw-2 on Apr 08, 2003; 2:12am
URL: http://quantlib.414.s1.nabble.com/Compiling-under-MSVC-tp10234.html

When building my SWIG generated wrapper for Python I get the following LINK
errors:

*****************
C:\Program Files\Microsoft Visual Studio\VC98\BIN\link.exe /DLL /nologo
/INCREMENTAL:NO /LIBPATH:e:\QuantLib\lib\win32\VisualStudio
/LIBPATH:c:\Python22\libs /EXPORT:init_QuantLib
build\temp.win32-2.2\Release\quantlib_wrap.obj
/OUT:build\lib.win32-2.2\QuantLib\_QuantLib.pyd
/IMPLIB:build\temp.win32-2.2\Release\_QuantLib.lib /subsystem:windows
/machine:I386

msvcprt.lib(MSVCP60.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> >(char const *,class
basic_string<char,struct std::char_traits<char>,class std::allocator<char>
>::allocator<char> const &)"
(??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@PBDABV?
$allocator@D@1@@Z) already defined in
QuantLib.lib(analyticeuropeanengine.obj)
msvcprt.lib(MSVCP60.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)"
(??1?$basic_string@DU?$char_traits@D@std@@V?allocator@D@2@@std@@QAE@XZ)
already defined in QuantLib.lib(analyticeuropeanengine.obj)
msvcprt.lib(MSVCP60.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> >(class
basic_string<char,struct std::char_traits<char>,class std::allocator<char>
>::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> > const &)"
(??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV01@@
Z) already
defined in QuantLib.lib(analyticeuropeanengine.obj)
msvcprt.lib(MSVCP60.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> >(class
basic_string<char,struct std::char_traits<char>,class std::allocator<char>
>::allocator<char> const &)"
(??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE
@ABV?$allocator@D@1@@Z) already defined in
QuantLib.lib(piecewiseflatforward.obj)
msvcprt.lib(MSVCP60.dll) : warning LNK4006: "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> >(char const *,class
basic_string<char,struct std::char_traits<char>,class std::allocator<char>
>::allocator<char> const &)"
(??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@PBDABV?
$allocator@D@1@@Z) already defined in
QuantLib.lib(analyticeuropeanengine.obj); second definition ignored
msvcprt.lib(MSVCP60.dll) : warning LNK4006: "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)"
(??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ)
already defined in QuantLib.lib(analyticeuropeanengine.obj); second
definition ignored
msvcprt.lib(MSVCP60.dll) : warning LNK4006: "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> >(class
basic_string<char,struct std::char_traits<char>,class std::allocator<char>
>::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> > const &)"
(??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV01@@
Z) already defined in QuantLib.lib(analyticeuropeanengine.obj); second
definition ignored
msvcprt.lib(MSVCP60.dll) : warning LNK4006: "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> >(class
basic_string<char,struct std::char_traits<char>,class std::allocator<char>
>::allocator<char> const &)"
(??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@ABV?$al
locator@D@1@@Z) already defined in QuantLib.lib(piecewiseflatforward.obj);
second definition ignored
   Creating library build\temp.win32-2.2\Release\_QuantLib.lib and object
build\temp.win32-2.2\Release\_QuantLib.exp
LINK : warning LNK4098: defaultlib "LIBCMT" conflicts with use of other
libs; use /NODEFAULTLIB:library
build\lib.win32-2.2\QuantLib\_QuantLib.pyd : fatal error LNK1169: one or
more multiply defined symbols found
error: command '"C:\Program Files\Microsoft Visual
Studio\VC98\BIN\link.exe"' failed with exit status 1169
***************

Any ideas on what could be causing this?

Andre
 
-------------------------------------------------------------------------
This e-mail is intended only for the use of the individual or entity named
above and may contain information that is confidential and privileged,
proprietary to the company and protected by law. If you are not the intended
recipient, you are hereby notified that any dissemination, distribution or
copying of this e-mail is strictly prohibited. Opinions, conclusions and
other information in this message that do not relate to the official
business of our company shall be understood as neither given nor endorsed by
it.