Help

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

Help

jeffrey

Hi all,

I have just  installed the quantlib software on my computer by following the steps given on : http://quantess.net/2012/09/ 26/quantlib-get-it-working-on- ubuntu/.

Now, when I am trying to  run the program below, I'm getting the following message: ql\quantlib.hpp: No such file or directory compilation terminated or fatal error: boost\algorithmstring.hpp: No such file or directory compilation terminated.


///usr/local/lib/include<ql\quantlib.hpp>

#include<ql\quantlib.hpp>
using namespace QuantLib;

int main(int, char*[]){

// Matrix declaration and population
Matrix A(2,2);
A[0][0] = 1; A[0][1] = 2;
A[1][0] = 3; A[1][1] = 4;

Matrix B(2,2);
B[0][0] = 5; B[0][1] = 6;
B[1][0] = 7; B[1][1] = 8;

// Outputting
std::cout << "Matrix A :" << std::endl << A << std::endl;
std::cout << "Matrix B :" << std::endl << B << std::endl;
std::cout << "A + B :" << std::endl << A + B << std::endl;

return 0;


}

Please  help me.

Thanks

------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today.
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Help

Luigi Ballabio
Hello,
    I've had a look at the page you linked. It made you install the
Boost headers in a non-standard location, and the compiler can't find
it. When you compile, you'll have to add the location of the Boost
headers to the compiler command line. The way to do that depends on
the way you're compiling your program, so you'll have to write back
and tell us how you're doing it.

Second, the backslash as a path separator only works on Windows, so
you should write
#include<ql/quantlib.hpp>
instead of
#include<ql\quantlib.hpp>

Later,
    Luigi


On Wed, Jan 22, 2014 at 2:12 PM, Mbongo Nkounga Jeffrey Ted Johnattan
<[hidden email]> wrote:

>
> Hi all,
>
> I have just  installed the quantlib software on my computer by following the
> steps given on : http://quantess.net/2012/09/ 26/quantlib-get-it-working-on-
> ubuntu/.
>
> Now, when I am trying to  run the program below, I'm getting the following
> message: ql\quantlib.hpp: No such file or directory compilation terminated
> or fatal error: boost\algorithmstring.hpp: No such file or directory
> compilation terminated.
>
>
> ///usr/local/lib/include<ql\quantlib.hpp>
>
> #include<ql\quantlib.hpp>
> using namespace QuantLib;
>
> int main(int, char*[]){
>
> // Matrix declaration and population
> Matrix A(2,2);
> A[0][0] = 1; A[0][1] = 2;
> A[1][0] = 3; A[1][1] = 4;
>
> Matrix B(2,2);
> B[0][0] = 5; B[0][1] = 6;
> B[1][0] = 7; B[1][1] = 8;
>
> // Outputting
> std::cout << "Matrix A :" << std::endl << A << std::endl;
> std::cout << "Matrix B :" << std::endl << B << std::endl;
> std::cout << "A + B :" << std::endl << A + B << std::endl;
>
> return 0;
>
>
> }
>
> Please  help me.
>
> Thanks
>
> ------------------------------------------------------------------------------
> CenturyLink Cloud: The Leader in Enterprise Cloud Services.
> Learn Why More Businesses Are Choosing CenturyLink Cloud For
> Critical Workloads, Development Environments & Everything In Between.
> Get a Quote or Start a Free Trial Today.
> http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
> _______________________________________________
> QuantLib-users mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>



--
<https://implementingquantlib.blogspot.com>
<https://twitter.com/lballabio>

------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today.
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Help

Luigi Ballabio
g++ -I /usr/local/lib/boost_1_50_0 help.cpp

will add the include path. You can add more than one -I option. "man
g++" will give you more help.

Luigi


On Fri, Jan 24, 2014 at 6:52 PM, Mbongo Nkounga Jeffrey Ted Johnattan
<[hidden email]> wrote:

> Thanks very much.
> To run a program I use the command : g++ space name of the program space -o
> space anything.
> For example, if the name of my program is help.cpp, in my terminal I write
> g++ help.cpp -o h.
> How can I avoid adding the location of the Boost headers to the compiler
> command line, or how to do that ?
>
>
> Thanks once more!
>
>
>



--
<https://implementingquantlib.blogspot.com>
<https://twitter.com/lballabio>

------------------------------------------------------------------------------
CenturyLink Cloud: The Leader in Enterprise Cloud Services.
Learn Why More Businesses Are Choosing CenturyLink Cloud For
Critical Workloads, Development Environments & Everything In Between.
Get a Quote or Start a Free Trial Today.
http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users