Hi,
I have a funny when building the SWIG wrapper on Win32 using the straightforward 'python setup.py build': The compile step goes well. When linking it gets a bunch (15) of unresolved externals: quantlib_wrap.obj : error LNK2001: unresolved external symbol "public: __thiscall QuantLib::Period::Period(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??0Period@QuantLib@@QAE@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocat or@D@2@@std@@@Z) quantlib_wrap.obj : error LNK2001: unresolved external symbol "public: __thiscall QuantLib::CashFlows::FloatingRateCoupon::FloatingRateCoupon(double,class CashFlows::Date const &,class CashFlows::Handle<class QuantLib::Indexes::Xibor> const &,class CashFlows::Date const &,class CashFlows::Date const &,int,double,class CashFlows::Date const &,class CashFlows::Date const &)" (??0FloatingRateCoupon@CashFlows@QuantLib@@QAE@NABVDate@2@ABV?$Handle@VXibor @Indexes@QuantLib@@@2@00HN00@Z) quantlib_wrap.obj : error LNK2001: unresolved external symbol "public: __thiscall QuantLib::TermStructures::CompoundForward::CompoundForward(class std::vector<class QuantLib::Date,class std::allocator<class QuantLib::Date> > const &,class vector<class QuantLib::Date,class std::allocator<class QuantLib::Date> >::vector<double,class std::allocator<double> > const &,class TermStructures::Date const &,class TermStructures::Date const &,enum TermStructures::Currency,class TermStructures::DayCounter const &,class TermStructures::Calendar const &,enum TermStructures::RollingConvention,int)" (??0CompoundForward@TermStructures@QuantLib@@QAE@ABV?$vector@VDate@QuantLib@ @V?$allocator@VDate@QuantLib@@@std@@@std@@ABV?$vector@NV?$allocator@N@std@@@ 4@ABVDate@2@2W4Currency@2@ABVDayCounter@2@ABVCalendar@2@W4RollingConvention@ 2@H@Z) quantlib_wrap.obj : error LNK2001: unresolved external symbol "public: __thiscall QuantLib::TermStructures::DiscountCurve::DiscountCurve(class TermStructures::Date const &,class std::vector<class QuantLib::Date,class std::allocator<class QuantLib::Date> > const &,class vector<class QuantLib::Date,class std::allocator<class QuantLib::Date> >::vector<double,class std::allocator<double> > const &,enum TermStructures::Currency,class TermStructures::DayCounter const &,class TermStructures::Calendar const &,enum TermStructures::RollingConvention)" (??0DiscountCurve@TermStructures@QuantLib@@QAE@ABVDate@2@ABV?$vector@VDate@Q uantLib@@V?$allocator@VDate@QuantLib@@@std@@@std@@ABV?$vector@NV?$allocator@ N@std@@@5@W4Currency@2@ABVDayCounter@2@ABVCalendar@2@W4RollingConvention@2@@ Z) quantlib_wrap.obj : error LNK2001: unresolved external symbol "public: virtual double __thiscall QuantLib::Pricers::SingleAssetOption::theta(void)const " (?theta@SingleAssetOption@Pricers@QuantLib@@UBENXZ) quantlib_wrap.obj : error LNK2001: unresolved external symbol "public: __thiscall QuantLib::TermStructures::SwapRateHelper::SwapRateHelper(class TermStructures::RelinkableHandle<class QuantLib::MarketElement> const &,int,int,enum TermStructures::TimeUnit,class TermStructures::Calendar const &,enum TermStructures::RollingConvention,int,bool,class TermStructures::DayCounter const &,int)" (??0SwapRateHelper@TermStructures@QuantLib@@QAE@ABV?$RelinkableHandle@VMarke tElement@QuantLib@@@2@HHW4TimeUnit@2@ABVCalendar@2@W4RollingConvention@2@H_N ABVDayCounter@2@H@Z) quantlib_wrap.obj : error LNK2001: unresolved external symbol "public: __thiscall QuantLib::TermStructures::PiecewiseFlatForward::PiecewiseFlatForward(enum TermStructures::Currency,class TermStructures::DayCounter const &,class TermStructures::Date const &,class TermStructures::Date const &,class std::vector<class QuantLib::Handle<class QuantLib::TermStructures::RateHelper>,class std::allocator<class QuantLib::Handle<class QuantLib::TermStructures::RateHelper> > > const &,double)" (??0PiecewiseFlatForward@TermStructures@QuantLib@@QAE@W4Currency@2@ABVDayCou nter@2@ABVDate@2@2ABV?$vector@V?$Handle@VRateHelper@TermStructures@QuantLib@ @@QuantLib@@V?$allocator@V?$Handle@VRateHelper@TermStructures@QuantLib@@@Qua ntLib@@@std@@@std@@N@Z) quantlib_wrap.obj : error LNK2001: unresolved external symbol "public: __thiscall QuantLib::Pricers::CliquetOption::CliquetOption(enum Pricers::Option::Type,double,double,class std::vector<double,class std::allocator<double> > const &,class std::vector<double,class std::allocator<double> > const &,class std::vector<double,class std::allocator<double> > const &,class std::vector<double,class std::allocator<double> > const &)" (??0CliquetOption@Pricers@QuantLib@@QAE@W4Type@Option@2@NNABV?$vector@NV?$al locator@N@std@@@std@@111@Z) quantlib_wrap.obj : error LNK2001: unresolved external symbol "public: double __thiscall QuantLib::Pricers::CliquetOption::value(void)const " (?value@CliquetOption@Pricers@QuantLib@@QBENXZ) quantlib_wrap.obj : error LNK2001: unresolved external symbol "public: double __thiscall QuantLib::Pricers::CliquetOption::delta(void)const " (?delta@CliquetOption@Pricers@QuantLib@@QBENXZ) quantlib_wrap.obj : error LNK2001: unresolved external symbol "public: double __thiscall QuantLib::Pricers::CliquetOption::gamma(void)const " (?gamma@CliquetOption@Pricers@QuantLib@@QBENXZ) quantlib_wrap.obj : error LNK2001: unresolved external symbol "public: double __thiscall QuantLib::Pricers::CliquetOption::theta(void)const " (?theta@CliquetOption@Pricers@QuantLib@@QBENXZ) quantlib_wrap.obj : error LNK2001: unresolved external symbol "public: double __thiscall QuantLib::Pricers::CliquetOption::vega(void)const " (?vega@CliquetOption@Pricers@QuantLib@@QBENXZ) quantlib_wrap.obj : error LNK2001: unresolved external symbol "public: double __thiscall QuantLib::Pricers::CliquetOption::rho(void)const " (?rho@CliquetOption@Pricers@QuantLib@@QBENXZ) quantlib_wrap.obj : error LNK2001: unresolved external symbol "public: double __thiscall QuantLib::Pricers::CliquetOption::dividendRho(void)const " (?dividendRho@CliquetOption@Pricers@QuantLib@@QBENXZ) build\lib.win32-2.2\QuantLib\QuantLibc.pyd : fatal error LNK1120: 15 unresolved externals If I then go and execute exactly the same link command (copy and pasted from the shell into a .bat file), these unresolved externals mysteriously dissapear and the .pyd is fully usable! Any help appreciated! André Louw Decillion Limited - "Your Risk Is Our Domain" Email: [hidden email] Office: +27 (11) 328 1256 Mobile: +27 (83) 414 5785 Fax: +27 (11) 442 4456 ------------------------------------------------------------------------- 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. |
At 08:20 AM 5/28/2002 +0200, Andre Louw wrote:
>I have a funny when building the SWIG wrapper on Win32 using the >straightforward 'python setup.py build': > >The compile step goes well. When linking it gets a bunch (15) of unresolved >externals: My guess is that you're compiling the current CVS version of QuantLib-Python while linking an older QuantLib library. Try to update your installed QuantLib version with the current CVS version. Under Windows you might consider using the QuantLib-Python MS Visual Studio project, instead of the standard 'setup.py build'. The Visual Studio project has a few "OnTheEdgeXXX" build configurations that link the QuantLib version they find in a relative ..\QuantLib path instead of the installed one. I use this trick to have a "stable" version of QuantLib installed, while hacking on the CVS trunk head. The only requirement is to check out all the CVS modules in the same folder as in: Projects\QuantLib Projects\QuantLib-Python Projects\QuantLib-SWIG Projects\QuantLibXL Projects\xlw Let me know if this solve your problem ciao -- Nando |
Free forum by Nabble | Edit this page |