Newbie problem with pricing an asian option

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Newbie problem with pricing an asian option

Simon Kronlund
Hi All,
 
I'am a newbie to C++ and QuantLib.
 
I'am trying to calculate a price for an asian option. I have used some code from the test-suite project, and have made some changes.
 
When I try to compile my project I receive the following errors:
 
Error 29 error LNK2019: unresolved external symbol "class boost::shared_ptr<class QuantLib::BlackVolTermStructure> __cdecl QuantLib::flatVol(class QuantLib::Date const &,class boost::shared_ptr<class QuantLib::Quote> const &,class QuantLib::DayCounter const &)" ([hidden email]) referenced in function "public: static void __cdecl SKAsianOption::SKMCDiscreteArithmeticAveragePrice(void)" ([hidden email]) asianpricer.obj 
 
Error 30 error LNK2019: unresolved external symbol "class boost::shared_ptr<class QuantLib::YieldTermStructure> __cdecl QuantLib::flatRate(class QuantLib::Date const &,class boost::shared_ptr<class QuantLib::Quote> const &,class QuantLib::DayCounter const &)" ([hidden email]) referenced in function "public: static void __cdecl SKAsianOption::SKMCDiscreteArithmeticAveragePrice(void)" ([hidden email]) asianpricer.obj 

 
 
I have located the error to the following lines:

boost::shared_ptr<YieldTermStructure> qTS = flatRate(today, qRate, dc);

boost::shared_ptr<BlackVolTermStructure> volTS = flatVol(today, vol, dc);

 

I have attached my project.

I deeply appreciate any help,

Best regards,

Simon Kronlund


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users

asianpricer.cpp (7K) Download Attachment
asianpricer.hpp (242 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Newbie problem with pricing an asian option

Luigi Ballabio

On Jan 31, 2008, at 5:57 PM, Simon Kronlund wrote:

> I'am a newbie to C++ and QuantLib.
>  
> I'am trying to calculate a price for an asian option. I have used some
> code from the test-suite project, and have made some changes.
>  
> When I try to compile my project I receive the following errors:
>  
> Error 29 error LNK2019: unresolved external symbol [...]
>  
> I have located the error to the following lines:
>
> boost::shared_ptr<YieldTermStructure> qTS = flatRate(today, qRate, dc);
> boost::shared_ptr<BlackVolTermStructure> volTS = flatVol(today, vol,
> dc);

Hi Simon,
        the functions above are not in the library---they are defined in the
test suite for convenience. If you want to use them, you'll have to add
to your project the file utilities.cpp from the test suite. Otherwise,
you can look at that file to see how the functions instantiate the
curves and do the same in your code.

Luigi


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users