|
From: Luigi B. <lui...@gm...> - 2022-01-19 11:09:58
|
Correct — also, you'll probably be missing the test initialization done in quantlibtestsuite.cpp. On Wed, Jan 19, 2022 at 11:11 AM 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 > |