VS Linking error

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

VS Linking error

Blazing Helios
Hi

I am having some Quantlib examples running fine in VS15 with QuantLib version 1.5 libs

I pulled QuantLib 1.11 and compiled libs which all went through fine but when I tried to run existing examples against news libs I'm getting below link error

Tried many ways to overcome this but failed. Please suggest how to resolve this link error

Thanks
Surya

Error:


Severity Code Description Project File Line Suppression State
Error LNK2019 unresolved external symbol "private: static class boost::shared_ptr<class QuantLib::DayCounter::Impl> __cdecl QuantLib::ActualActual::implementation(enum QuantLib::ActualActual::Convention,class QuantLib::Schedule const &)" (?implementation@ActualActual@QuantLib@@CA?AV?$shared_ptr@VImpl@DayCounter@QuantLib@@@boost@@W4Convention@12@AEBVSchedule@2@@Z) referenced in function "public: __cdecl QuantLib::ActualActual::ActualActual(enum QuantLib::ActualActual::Convention,class QuantLib::Schedule const &)" (??0ActualActual@QuantLib@@QEAA@W4Convention@01@AEBVSchedule@1@@Z) ql_examples C:\work\ql_examples\black_scholes_merton_process.obj 1


VS15 (v140 toolset), Boost 1.64, QuantLib 1.11

Code:


#include <iostream>
#include <boost/shared_ptr.hpp>
#include <ql/quantlib.hpp>

using namespace QuantLib;

void bsmp() {

Date refDate = Date(27, Sep, 2009);
Rate riskFreeRate = 0.0321;
Rate dividendRate = 0.0128;
Real spot = 52.0;
Rate vol = 0.2144;
Calendar cal = TARGET();
DayCounter dc = ActualActual();

boost::shared_ptr<YieldTermStructure> rdStruct(new FlatForward(refDate, riskFreeRate, dc));
boost::shared_ptr<YieldTermStructure> rqStruct(new FlatForward(refDate, dividendRate, dc));

Handle<YieldTermStructure> rdHandle(rdStruct);
Handle<YieldTermStructure> rqHandle(rqStruct);

boost::shared_ptr<SimpleQuote> spotQuote(new SimpleQuote(spot));
Handle<Quote> spotHandle(spotQuote);

boost::shared_ptr<BlackVolTermStructure> volQuote(new BlackConstantVol(refDate, cal, vol, dc));
Handle<BlackVolTermStructure> volHandle(volQuote);

boost::shared_ptr<BlackScholesMertonProcess> bsmProcess(new BlackScholesMertonProcess(spotHandle, rqHandle, rdHandle, volHandle));
BigInteger seed = 12324;
MersenneTwisterUniformRng unifMt(seed);
BoxMullerGaussianRng<MersenneTwisterUniformRng> bmGauss(unifMt);
Time dt = 0.10, t = 0.0;
Real x = spotQuote->value();
Real dw;
Size numVals = 10;
std::cout << " Risk neutral drift : " << bsmProcess->drift(t + dt, x) << std::endl;
std::cout << " Diffusion : " << bsmProcess->diffusion(t + dt, x) << std::endl;
std::cout << " - - - - - - - - - - - - - - - - - - - - - -" << std::endl;
for (Size j = 1; j <= numVals; ++j) {
dw = bmGauss.next().value;
x = bsmProcess->evolve(t, x, dt, dw);
std::cout << " Time : " << t + dt << ", S_t : " << x << std::endl;
t += dt;
}
}

void main()
{
bsmp();
}


 



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users