|
From: Luigi B. <lui...@gm...> - 2008-07-15 08:23:56
|
On Sat, 2008-07-12 at 20:41 -0700, mariav wrote: > I wrote an extremely simple c++ program, but I cannot compile it. > > 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 > 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 Hi Maria, as for most Linux programs, you also have to run 'make install' after 'make'. If you have administrator privileges on your computer, you can run 'make install' with your current configuration (or 'sudo make install' if you need to get the required privileges.) After that, g++ filename.cpp -o filename -lQuantLib should work. Otherwise, you can install in your user space: run first ./configure --with-boost-include=/home/maria/Boost/boost_1_35_0 --prefix=/home/maria/ (on one line, of course) and then 'make install'. The installation will create a few directories (include, lib, bin...) in your home directory; if you want them somewhere else, just provide a different prefix to configure. After this, you can use g++ filename.cpp -o filename -l/home/maria/include -L/home/maria/lib -lQuantLib (of course, replace /home/maria with the correct prefix if you chose a different one.) Luigi -- Any software problem can be solved by adding another layer of indirection. -- Steven M. Bellovin |