Hi, I am a new user of quantlib (3 days). I am trying to build a variance swap pricer. when i create a new empty project with utilities.hpp et cpp and varianceswaps.hpp cpp and try to buil it i have many link errors. is possible to have a tutorial do build a varswaps pricer inspired by the testsuit exmple? Regards 1>------ Début de la génération : Projet : VarSwap, Configuration : Release Win32 ------ 1> varswap.cpp 1>utilities.obj : error LNK2001: symbole externe non résolu "void __cdecl boost::assertion_failed(char const *,char const *,char const *,long)" (?assertion_failed@boost@@YAXPBD00J@Z) 1>utilities.obj : error LNK2001: symbole externe non résolu "public: __thiscall QuantLib::BlackVolatilityTermStructure::BlackVolatilityTermStructure(class QuantLib::Date const &,class QuantLib::Calendar const &,enum QuantLib::BusinessDayConvention,class QuantLib::DayCounter const &)" (??0BlackVolatilityTermStructure@QuantLib@@QAE@ABVDate@1@ABVCalendar@1@W4BusinessDayConvention@1@ABVDayCounter@1@@Z) 1>utilities.obj : error LNK2001: symbole externe non résolu "public: __thiscall QuantLib::BlackVolatilityTermStructure::BlackVolatilityTermStructure(unsigned int,class QuantLib::Calendar const &,enum QuantLib::BusinessDayConvention,class QuantLib::DayCounter const &)" (??0BlackVolatilityTermStructure@QuantLib@@QAE@IABVCalendar@1@W4BusinessDayConvention@1@ABVDayCounter@1@@Z) 1>utilities.obj : error LNK2001: symbole externe non résolu "public: __thiscall QuantLib::FlatForward::FlatForward(class QuantLib::Date const &,class QuantLib::Handle<class QuantLib::Quote> const &,class QuantLib::DayCounter const &,enum QuantLib::Compounding,enum QuantLib::Frequency)" (??0FlatForward@QuantLib@@QAE@ABVDate@1@ABV?$Handle@VQuote@QuantLib@@@1@ABVDayCounter@1@W4Compounding@1@W4Frequency@1@@Z) 1>utilities.obj : error LNK2001: symbole externe non résolu "public: __thiscall QuantLib::FlatForward::FlatForward(unsigned int,class QuantLib::Calendar const &,class QuantLib::Handle<class QuantLib::Quote> const &,class QuantLib::DayCounter const &,enum QuantLib::Compounding,enum QuantLib::Frequency)" (??0FlatForward@QuantLib@@QAE@IABVCalendar@1@ABV?$Handle@VQuote@QuantLib@@@1@ABVDayCounter@1@W4Compounding@1@W4Frequency@1@@Z) 1>utilities.obj : error LNK2001: symbole externe non résolu "public: void __thiscall QuantLib::IndexManager::clearHistories(void)" (?clearHistories@IndexManager@QuantLib@@QAEXXZ) 1>utilities.obj : error LNK2001: symbole externe non résolu "public: static class QuantLib::Date __cdecl QuantLib::Date::maxDate(void)" (?maxDate@Date@QuantLib@@SA?AV12@XZ) 1>utilities.obj : error LNK2001: symbole externe non résolu "public: __thiscall QuantLib::Date::Date(void)" (??0Date@QuantLib@@QAE@XZ) 1>utilities.obj : error LNK2001: symbole externe non résolu "public: virtual void __thiscall QuantLib::TermStructure::update(void)" (?update@TermStructure@QuantLib@@UAEXXZ) 1>utilities.obj : error LNK2001: symbole externe non résolu "public: virtual class QuantLib::Date const & __thiscall QuantLib::TermStructure::referenceDate(void)const " (?referenceDate@TermStructure@QuantLib@@UBEABVDate@2@XZ) 1>utilities.obj : error LNK2001: symbole externe non résolu "public: virtual char const * __thiscall QuantLib::Error::what(void)const " (?what@Error@QuantLib@@UBEPBDXZ) 1>utilities.obj : error LNK2001: symbole externe non résolu "public: __thiscall QuantLib::Error::Error(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,long,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (??0Error@QuantLib@@QAE@ABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@J00@Z) 1>utilities.obj : error LNK2001: symbole externe non résolu "public: void __thiscall QuantLib::Observable::notifyObservers(void)" (?notifyObservers@Observable@QuantLib@@QAEXXZ) 1>varswap.obj : error LNK2001: symbole externe non résolu "public: __thiscall QuantLib::BlackScholesMertonProcess::BlackScholesMertonProcess(class QuantLib::Handle<class QuantLib::Quote> const &,class QuantLib::Handle<class QuantLib::YieldTermStructure> const &,class QuantLib::Handle<class QuantLib::YieldTermStructure> const &,class QuantLib::Handle<class QuantLib::BlackVolTermStructure> const &,class boost::shared_ptr<class QuantLib::StochasticProcess1D::discretization> const &)" (??0BlackScholesMertonProcess@QuantLib@@QAE@ABV?$Handle@VQuote@QuantLib@@@1@ABV?$Handle@VYieldTermStructure@QuantLib@@@1@1ABV?$Handle@VBlackVolTermStructure@QuantLib@@@1@ABV?$shared_ptr@Vdiscretization@StochasticProcess1D@QuantLib@@@boost@@@Z) 1>varswap.obj : error LNK2001: symbole externe non résolu "private: static double const QuantLib::InverseCumulativeNormal::a2_" (?a2_@InverseCumulativeNormal@QuantLib@@0NB) 1>varswap.obj : error LNK2001: symbole externe non résolu "public: __thiscall QuantLib::EuropeanOption::EuropeanOption(class boost::shared_ptr<class QuantLib::StrikedTypePayoff> const &,class boost::shared_ptr<class QuantLib::Exercise> const &)" (??0EuropeanOption@QuantLib@@QAE@ABV?$shared_ptr@VStrikedTypePayoff@QuantLib@@@boost@@ABV?$shared_ptr@VExercise@QuantLib@@@3@@Z) 1>varswap.obj : error LNK2001: symbole externe non résolu "private: static double __cdecl QuantLib::InverseCumulativeNormal::tail_value(double)" (?tail_value@InverseCumulativeNormal@QuantLib@@CANN@Z) 1>varswap.obj : error LNK2001: symbole externe non résolu "public: __thiscall QuantLib::AnalyticEuropeanEngine::AnalyticEuropeanEngine(class boost::shared_ptr<class QuantLib::GeneralizedBlackScholesProcess> const &)" (??0AnalyticEuropeanEngine@QuantLib@@QAE@ABV?$shared_ptr@VGeneralizedBlackScholesProcess@QuantLib@@@boost@@@Z) 1>varswap.obj : error LNK2001: symbole externe non résolu "private: static double const QuantLib::InverseCumulativeNormal::a3_" (?a3_@InverseCumulativeNormal@QuantLib@@0NB) 1>varswap.obj : error LNK2001: symbole externe non résolu "private: static double const QuantLib::InverseCumulativeNormal::x_high_" (?x_high_@InverseCumulativeNormal@QuantLib@@0NB) 1>varswap.obj : error LNK2001: symbole externe non résolu "class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl QuantLib::operator<<(class std::basic_ostream<char,struct std::char_traits<char> > &,class QuantLib::Date const &)" (??6QuantLib@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@AAV12@ABVDate@0@@Z) 1>varswap.obj : error LNK2001: symbole externe non résolu "public: __thiscall QuantLib::BlackVarianceSurface::BlackVarianceSurface(class QuantLib::Date const &,class QuantLib::Calendar const &,class std::vector<class QuantLib::Date,class std::allocator<class QuantLib::Date> > const &,class std::vector<double,class std::allocator<double> > const &,class QuantLib::Matrix const &,class QuantLib::DayCounter const &,enum QuantLib::BlackVarianceSurface::Extrapolation,enum QuantLib::BlackVarianceSurface::Extrapolation)" (??0BlackVarianceSurface@QuantLib@@QAE@ABVDate@1@ABVCalendar@1@ABV?$vector@VDate@QuantLib@@V?$allocator@VDate@QuantLib@@@std@@@std@@ABV?$vector@NV?$allocator@N@std@@@5@ABVMatrix@1@ABVDayCounter@1@W4Extrapolation@01@6@Z) 1>varswap.obj : error LNK2001: symbole externe non résolu "public: __thiscall QuantLib::EuropeanExercise::EuropeanExercise(class QuantLib::Date const &)" (??0EuropeanExercise@QuantLib@@QAE@ABVDate@1@@Z) 1>varswap.obj : error LNK2001: symbole externe non résolu "private: static double const QuantLib::InverseCumulativeNormal::b5_" (?b5_@InverseCumulativeNormal@QuantLib@@0NB) 1>varswap.obj : error LNK2001: symbole externe non résolu "private: static double const QuantLib::InverseCumulativeNormal::b4_" (?b4_@InverseCumulativeNormal@QuantLib@@0NB) 1>varswap.obj : error LNK2001: symbole externe non résolu "private: static double const QuantLib::InverseCumulativeNormal::b2_" (?b2_@InverseCumulativeNormal@QuantLib@@0NB) 1>varswap.obj : error LNK2001: symbole externe non résolu "private: static double const QuantLib::InverseCumulativeNormal::a4_" (?a4_@InverseCumulativeNormal@QuantLib@@0NB) 1>varswap.obj : error LNK2001: symbole externe non résolu "private: static double const QuantLib::InverseCumulativeNormal::a1_" (?a1_@InverseCumulativeNormal@QuantLib@@0NB) 1>varswap.obj : error LNK2001: symbole externe non résolu "private: static double const QuantLib::InverseCumulativeNormal::b1_" (?b1_@InverseCumulativeNormal@QuantLib@@0NB) 1>varswap.obj : error LNK2001: symbole externe non résolu "private: static double const QuantLib::InverseCumulativeNormal::x_low_" (?x_low_@InverseCumulativeNormal@QuantLib@@0NB) 1>varswap.obj : error LNK2001: symbole externe non résolu "public: virtual bool __thiscall QuantLib::Integrator::integrationSuccess(void)const " (?integrationSuccess@Integrator@QuantLib@@UBE_NXZ) 1>varswap.obj : error LNK2001: symbole externe non résolu "public: double __thiscall QuantLib::Integrator::operator()(class boost::function<double __cdecl(double)> const &,double,double)const " (??RIntegrator@QuantLib@@QBENABV?$function@$$A6ANN@Z@boost@@NN@Z) 1>varswap.obj : error LNK2001: symbole externe non résolu "public: virtual void __thiscall QuantLib::PlainVanillaPayoff::accept(class QuantLib::AcyclicVisitor &)" (?accept@PlainVanillaPayoff@QuantLib@@UAEXAAVAcyclicVisitor@2@@Z) 1>varswap.obj : error LNK2001: symbole externe non résolu "public: virtual double __thiscall QuantLib::PlainVanillaPayoff::operator()(double)const " (??RPlainVanillaPayoff@QuantLib@@UBENN@Z) 1>varswap.obj : error LNK2001: symbole externe non résolu "public: static class QuantLib::Date __cdecl QuantLib::Date::todaysDate(void)" (?todaysDate@Date@QuantLib@@SA?AV12@XZ) 1>varswap.obj : error LNK2001: symbole externe non résolu "public: __thiscall QuantLib::Date::Date(long)" (??0Date@QuantLib@@QAE@J@Z) 1>varswap.obj : error LNK2001: symbole externe non résolu "public: class QuantLib::Handle<class QuantLib::YieldTermStructure> const & __thiscall QuantLib::GeneralizedBlackScholesProcess::riskFreeRate(void)const " (?riskFreeRate@GeneralizedBlackScholesProcess@QuantLib@@QBEABV?$Handle@VYieldTermStructure@QuantLib@@@2@XZ) 1>varswap.obj : error LNK2001: symbole externe non résolu "public: __thiscall QuantLib::SegmentIntegral::SegmentIntegral(unsigned int)" (??0SegmentIntegral@QuantLib@@QAE@I@Z) 1>varswap.obj : error LNK2001: symbole externe non résolu "private: static double const QuantLib::InverseCumulativeNormal::b3_" (?b3_@InverseCumulativeNormal@QuantLib@@0NB) 1>varswap.obj : error LNK2001: symbole externe non résolu "private: __thiscall QuantLib::Settings::Settings(void)" (??0Settings@QuantLib@@AAE@XZ) 1>varswap.obj : error LNK2001: symbole externe non résolu "public: __thiscall QuantLib::BlackVarianceCurve::BlackVarianceCurve(class QuantLib::Date const &,class std::vector<class QuantLib::Date,class std::allocator<class QuantLib::Date> > const &,class std::vector<double,class std::allocator<double> > const &,class QuantLib::DayCounter const &,bool)" (??0BlackVarianceCurve@QuantLib@@QAE@ABVDate@1@ABV?$vector@VDate@QuantLib@@V?$allocator@VDate@QuantLib@@@std@@@std@@ABV?$vector@NV?$allocator@N@std@@@4@ABVDayCounter@1@_N@Z) 1>varswap.obj : error LNK2001: symbole externe non résolu "public: virtual class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall QuantLib::TypePayoff::description(void)const " (?description@TypePayoff@QuantLib@@UBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ) 1>varswap.obj : error LNK2001: symbole externe non résolu "public: __thiscall QuantLib::BrownianBridge::BrownianBridge(class QuantLib::TimeGrid const &)" (??0BrownianBridge@QuantLib@@QAE@ABVTimeGrid@1@@Z) 1>varswap.obj : error LNK2001: symbole externe non résolu "private: static double const QuantLib::InverseCumulativeNormal::a6_" (?a6_@InverseCumulativeNormal@QuantLib@@0NB) 1>varswap.obj : error LNK2001: symbole externe non résolu "private: void __thiscall QuantLib::MersenneTwisterUniformRng::twist(void)const " (?twist@MersenneTwisterUniformRng@QuantLib@@ABEXXZ) 1>varswap.obj : error LNK2001: symbole externe non résolu "public: __thiscall QuantLib::MersenneTwisterUniformRng::MersenneTwisterUniformRng(unsigned long)" (??0MersenneTwisterUniformRng@QuantLib@@QAE@K@Z) 1>varswap.obj : error LNK2001: symbole externe non résolu "class std::basic_ostream<char,struct std::char_traits<char> > & __cdecl QuantLib::detail::operator<<(class std::basic_ostream<char,struct std::char_traits<char> > &,struct QuantLib::detail::percent_holder const &)" (??6detail@QuantLib@@YAAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@AAV23@ABUpercent_holder@01@@Z) 1>varswap.obj : error LNK2001: symbole externe non résolu "private: static double const QuantLib::InverseCumulativeNormal::a5_" (?a5_@InverseCumulativeNormal@QuantLib@@0NB) 1>varswap.obj : error LNK2001: symbole externe non résolu "public: double __thiscall QuantLib::GeneralStatistics::variance(void)const " (?variance@GeneralStatistics@QuantLib@@QBENXZ) 1>varswap.obj : error LNK2001: symbole externe non résolu "public: double __thiscall QuantLib::GeneralStatistics::mean(void)const " (?mean@GeneralStatistics@QuantLib@@QBENXZ) 1>varswap.obj : error LNK2001: symbole externe non résolu "public: __thiscall QuantLib::TimeGrid::TimeGrid(double,unsigned int)" (??0TimeGrid@QuantLib@@QAE@NI@Z) 1>varswap.obj : error LNK2001: symbole externe non résolu "public: class QuantLib::InterestRate __thiscall QuantLib::YieldTermStructure::zeroRate(double,enum QuantLib::Compounding,enum QuantLib::Frequency,bool)const " (?zeroRate@YieldTermStructure@QuantLib@@QBE?AVInterestRate@2@NW4Compounding@2@W4Frequency@2@_N@Z) 1>varswap.obj : error LNK2001: symbole externe non résolu "public: double __thiscall QuantLib::YieldTermStructure::discount(double,bool)const " (?discount@YieldTermStructure@QuantLib@@QBENN_N@Z) 1>varswap.obj : error LNK2001: symbole externe non résolu "public: virtual void __thiscall QuantLib::VarianceSwap::arguments::validate(void)const " (?validate@arguments@VarianceSwap@QuantLib@@UBEXXZ) 1>varswap.obj : error LNK2001: symbole externe non résolu "public: double __thiscall QuantLib::VarianceSwap::variance(void)const " (?variance@VarianceSwap@QuantLib@@QBENXZ) 1>varswap.obj : error LNK2001: symbole externe non résolu "public: __thiscall QuantLib::VarianceSwap::VarianceSwap(enum QuantLib::Position::Type,double,double,class QuantLib::Date const &,class QuantLib::Date const &)" (??0VarianceSwap@QuantLib@@QAE@W4Type@Position@1@NNABVDate@1@1@Z) 1>varswap.obj : error LNK2001: symbole externe non résolu "public: virtual double __thiscall QuantLib::EulerDiscretization::variance(class QuantLib::StochasticProcess1D const &,double,double,double)const " (?variance@EulerDiscretization@QuantLib@@UBENABVStochasticProcess1D@2@NNN@Z) 1>varswap.obj : error LNK2001: symbole externe non résolu "public: virtual class QuantLib::Disposable<class QuantLib::Matrix> __thiscall QuantLib::EulerDiscretization::covariance(class QuantLib::StochasticProcess const &,double,class QuantLib::Array const &,double)const " (?covariance@EulerDiscretization@QuantLib@@UBE?AV?$Disposable@VMatrix@QuantLib@@@2@ABVStochasticProcess@2@NABVArray@2@N@Z) 1>varswap.obj : error LNK2001: symbole externe non résolu "public: virtual class QuantLib::Disposable<class QuantLib::Matrix> __thiscall QuantLib::EulerDiscretization::diffusion(class QuantLib::StochasticProcess const &,double,class QuantLib::Array const &,double)const " (?diffusion@EulerDiscretization@QuantLib@@UBE?AV?$Disposable@VMatrix@QuantLib@@@2@ABVStochasticProcess@2@NABVArray@2@N@Z) 1>varswap.obj : error LNK2001: symbole externe non résolu "public: virtual double __thiscall QuantLib::EulerDiscretization::diffusion(class QuantLib::StochasticProcess1D const &,double,double,double)const " (?diffusion@EulerDiscretization@QuantLib@@UBENABVStochasticProcess1D@2@NNN@Z) 1>varswap.obj : error LNK2001: symbole externe non résolu "public: virtual class QuantLib::Disposable<class QuantLib::Array> __thiscall QuantLib::EulerDiscretization::drift(class QuantLib::StochasticProcess const &,double,class QuantLib::Array const &,double)const " (?drift@EulerDiscretization@QuantLib@@UBE?AV?$Disposable@VArray@QuantLib@@@2@ABVStochasticProcess@2@NABVArray@2@N@Z) 1>varswap.obj : error LNK2001: symbole externe non résolu "public: virtual double __thiscall QuantLib::EulerDiscretization::drift(class QuantLib::StochasticProcess1D const &,double,double,double)const " (?drift@EulerDiscretization@QuantLib@@UBENABVStochasticProcess1D@2@NNN@Z) 1>varswap.obj : error LNK2001: symbole externe non résolu "public: virtual class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __thiscall QuantLib::StrikedTypePayoff::description(void)const " (?description@StrikedTypePayoff@QuantLib@@UBE?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ) 1>libboost_unit_test_framework-vc140-mt-1_61.lib(unit_test_main.obj) : error LNK2001: symbole externe non résolu "class boost::unit_test::test_suite * __cdecl init_unit_test_suite(int,char * * const)" (?init_unit_test_suite@@YAPAVtest_suite@unit_test@boost@@HQAPAD@Z) 1>C:\QuantLib\QuantLibVisual2015\project\exemple\Release\VarSwap.exe : fatal error LNK1120: 64 externes non résolus ========== Génération : 0 a réussi, 1 a échoué, 0 mis à jour, 0 a été ignoré ========== ------------------------------------------------------------------------------ _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
You're probably not linking the QuantLib library to your project. The easiest way to do it is to add the line #include <ql/auto_link.hpp> to the file where you define your main(). If you haven't done so already, you also have to set the correct include and library path as explained in the "QuantLib Usage" section at <http://quantlib.org/install/vc10.shtml>. Hope this helps, Luigi On Tue, Aug 30, 2016 at 4:24 PM Mehdi Korti <[hidden email]> wrote:
------------------------------------------------------------------------------ _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
Free forum by Nabble | Edit this page |