|
From: mariav <mar...@ya...> - 2008-07-15 14:45:21
|
Thank you, Luigi. That part worked after I followed your instructions. I have
new errors now, but I work on my own for some time before posting a question
to the forum. Thanks!
mariav wrote:
>
> I wrote an extremely simple c++ program, but I cannot compile it. The
> program is the following:
>
> #include <ql/quantlib.hpp>
> #include <iostream>
>
> using namespace QuantLib;
>
> int main()
> {
> std::cout << "Hello world!" << std::endl;
> return 0;
> }
>
> if I compile using
> g++ filename.cpp -o filename
>
> I get the error messages:
> error: ql/quantlib.hpp: No such file or directory
> 'Quantlib' is not a namespace-name
> expected namespace-name before ';' token
>
> By doing an investigation on this forum (and on the internet) I read that
> I should compile using
>
> g++ filename.cpp -o filename -l/path/to/includefiles -L/path/to/libfiles
> -lql
>
> However, I have no idea what is the path to include and the path to the
> library files. That is, I understand that in the above line I have to
> replace /path/to/includefile to the path that applies to my installation
> (the same for /path/to/libfiles). However, how can I find that? I have no
> idea of what to type there.
>
> In other forum response I found I only need to use
> g++ filename.cpp -o filename -lQuantLib
>
> That does not work. I get the same errors that I obtain if I do not add
> the -lQuantLib
>
> My installation of Quantlib was done in the following way: I created a
> subdirectory called Quantlib in my
> home directory and extracted the files QuantLib-0.9.0 to there. I went to
> the QuantLib-0.9.0 directory (home/maria/Quantlib/QuantLib-0.9.0/ ) and
> typed
>
> ./configure --with-boost-include=/home/maria/Boost/boost_1_35_0
> --with-boost-lib=/home/maria/Boost/boost_1_35_0/libs
>
> make
>
> So, what should I type in order to compile my simple program? THANKS!
>
>
>
--
View this message in context: http://www.nabble.com/how-to-compile-a-program-that-uses-quantlib-tp18425958p18467037.html
Sent from the quantlib-dev mailing list archive at Nabble.com.
|