|
From: Luigi B. <lui...@gm...> - 2022-01-19 14:40:21
|
I'm guessing you chose to configure the library with thread-safe observer and using std::shared_ptr instead of boost::shared_ptr? In that case, you'll need to use -std=c++17. If you use boost::shared_ptr, c++11 is enough. Luigi On Wed, Jan 19, 2022 at 2:12 PM Vamshi Krishna <kri...@gm...> wrote: > Thanks for your reply and suggestion, > > i have tried with following way and getting different error > > *g++ -std=c++11 BermudanSwaption.cpp > -I/home/vamshik/vamshi/boost/local/include > -L/home/vamshik/vamshi/boost/local/lib > -I/home/vamshik/vamshi/quantlib/local/include/ > -L/home/vamshik/vamshi/qunatlib/local/lib/libQuantLib.a > -L/home/vamshik/vamshi/qunatlib/local/lib -o testBS* > > In file included from > /home/vamshik/vamshi/quantlib/local/include/ql/patterns/lazyobject.hpp:27:0, > from > /home/vamshik/vamshi/quantlib/local/include/ql/instrument.hpp:28, > from > /home/vamshik/vamshi/quantlib/local/include/ql/option.hpp:27, > from > /home/vamshik/vamshi/quantlib/local/include/ql/instruments/swaption.hpp:32, > from BermudanSwaption.cpp:26: > > > */home/vamshik/vamshi/quantlib/local/include/ql/patterns/observable.hpp: > In member function ‘void QuantLib::Observer::Proxy::update() > const’:/home/vamshik/vamshi/quantlib/local/include/ql/patterns/observable.hpp:313:38: > error: ‘class QuantLib::Observer’ has no member named ‘weak_from_this’ > = observer_->weak_from_this();* > > *Give some suggestion to resolve this* > > > *Regards* > *Vamshi* > > On Wed, Jan 19, 2022 at 3:38 PM Jonathan Sweemer <sw...@gm...> > wrote: > >> Hi Vamshi, >> >> Looks like you need to link with the following flags as well (assuming >> you compiled QuantLib as a static library): >> >> -l boost_unit_test_framework -l QuantLib >> >> You will need to specify the directory where libQuantLib.a is found as >> well. >> >> I recommend using CMake to manage your project to simplify the task of >> setting the compiler and linker flags if you can. >> >> >> 2022년 1월 19일 (수) 16:39, Vamshi Krishna <kri...@gm...>님이 작성: >> >>> Hiii users >>> I have run below command to compile hestonmodel.cpp but i am getting >>> errors of undefined reference . I am using Centos 7. >>> >>> Could anybody help me to understand how to resolve this issue? >>> >>> >>> *g++ -I/home/vamshik/vamshi/quantlib/local/ql/include/ hestonmodel.cpp >>> -o testhm -I/home/vamshik/vamshi/boost/local/include/ >>> -L/home/vamshik/vamshi/boost/local/lib -pthread -lboost_thread* >>> >>> >>> >>> *ERRORS*/lib/../lib64/crt1.o: In function `_start': >>> (.text+0x20): undefined reference to `main' >>> /tmp/ccVOvYFx.o: In function `(anonymous >>> namespace)::getDAXCalibrationMarketData()': >>> hestonmodel.cpp:(.text+0xc7): undefined reference to >>> `QuantLib::TARGET::TARGET()' >>> hestonmodel.cpp:(.text+0x340): undefined reference to >>> `QuantLib::flatRate(QuantLib::Date const&, double, QuantLib::DayCounter >>> const&)' >>> /tmp/ccVOvYFx.o: In function `HestonModelTest::testBlackCalibration()': >>> hestonmodel.cpp:(.text+0x9a6): undefined reference to >>> `boost::unit_test::unit_test_log_t::operator<<(boost::unit_test::log::begin >>> const&)' >>> hestonmodel.cpp:(.text+0x9c0): undefined reference to >>> `boost::unit_test::unit_test_log_t::operator()(boost::unit_test::log_level)' >>> hestonmodel.cpp:(.text+0x9f8): undefined reference to >>> `boost::unit_test::ut_detail::entry_value_collector::operator<<(boost::unit_test::lazy_ostream >>> const&) const' >>> hestonmodel.cpp:(.text+0xa16): undefined reference to >>> `boost::unit_test::ut_detail::entry_value_collector::~entry_value_collector()' >>> hestonmodel.cpp:(.text+0xa25): undefined reference to >>> `QuantLib::SavedSettings::SavedSettings()' >>> hestonmodel.cpp:(.text+0xa2a): undefined reference to >>> `QuantLib::Date::todaysDate()' >>> hestonmodel.cpp:(.text+0xaf5): undefined reference to >>> `QuantLib::flatRate(double, QuantLib::DayCounter const&)' >>> hestonmodel.cpp:(.text+0xb51): undefined reference to >>> `QuantLib::flatRate(double, QuantLib::DayCounter const&)' >>> hestonmodel.cpp:(.text+0xe5f): undefined reference to >>> `QuantLib::Date::Date()' >>> hestonmodel.cpp:(.text+0xe6e): undefined reference to >>> `QuantLib::Date::Date()' >>> hestonmodel.cpp:(.text+0xeb5): undefined reference to >>> `QuantLib::Calendar::advance(QuantLib::Date const&, QuantLib::Period >>> const&, QuantLib::BusinessDayConvention, bool) const' >>> hestonmodel.cpp:(.text+0xf80): undefined reference to >>> `QuantLib::YieldTermStructure::discount(double, bool) const' >>> hestonmodel.cpp:(.text+0xfca): undefined reference to >>> `QuantLib::YieldTermStructure::discount(double, bool) const' >>> hestonmodel.cpp:(.text+0x132c): undefined reference to >>> `QuantLib::LevenbergMarquardt::LevenbergMarquardt(double, double, double, >>> bool)' >>> _______________________________________________ >>> QuantLib-users mailing list >>> Qua...@li... >>> https://lists.sourceforge.net/lists/listinfo/quantlib-users >>> >> _______________________________________________ > QuantLib-users mailing list > Qua...@li... > https://lists.sourceforge.net/lists/listinfo/quantlib-users > |