Login  Register

Re: Cant compile equityoption.cpp

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

Re: Cant compile equityoption.cpp

Max Giolitti
6 posts
Ah, amateur mistake. This works now. Thanks for putting up with my questions. My NEXT problem is that the demo program Equityoption.cpp gives me an error:

(from .cpp)
        boost::shared_ptr<StrikedTypePayoff> payoff(
                                        new PlainVanillaPayoff(type, strike));

    boost::shared_ptr<StochasticProcess> stochasticProcess(
                 new BlackScholesMertonProcess(underlyingH, flatDividendTS,
                                               flatTermStructure, flatVolTS));

EquityOption.cpp: In function ‘int main(int, char**)’:
EquityOption.cpp:113: error: expected type-specifier before ‘BlackScholesMertonProcess’
EquityOption.cpp:113: error: expected `)' before ‘BlackScholesMertonProcess’
/usr/include/boost/shared_ptr.hpp: In constructor ‘boost::shared_ptr<T>::shared_ptr(Y*) [with Y = int, T = QuantLib::StochasticProcess]’:
EquityOption.cpp:114:   instantiated from here
/usr/include/boost/shared_ptr.hpp:124: error: cannot convert ‘int*’ to ‘QuantLib::StochasticProcess*’ in initialization

My objective is to get QuantLib working using python, but let me try to figure SWIG out on my own.
Thx for your help!
Max

Luigi Ballabio <[hidden email]> wrote:

On Sep 9, 2006, at 5:22 PM, Max Giolitti wrote:

> Thanks Eric, by using g++ I was able to make some progress. Now I have
> the following problem. Using
> ====hello.cpp=========
> #  include
>
> int main()
> {
>   printf("Hello World of Linux\n");
>   exit(0);
> }
>
> and compiling using g++ -o hello hello.cpp I get a large list of
> errors. The first 2 are

You have to tell the compiler to link QuantLib with your executable.
Change the above into
g++ -o hello hello.cpp -lQuantLib

Luigi



How low will we go? Check out Yahoo! Messenger’s low PC-to-Phone call rates.