I'm trying to learn QuantLib, this is my first program with which i intend to check that my environment is ok and i'm able to link to quantlib:
#include <ql/time/all.hpp>
using namespace QuantLib;
int main ()
{
Date d1(14, February, 2014);
return 0;
}
I've got my quantlib libraries installed under /usr/local/lib, headers under /usr/local/include/ql. I try to compile this little program with:
$ LC_ALL=C g++ -Wall -lQuantLib -o sample1 quantlib-sample-1.cpp
/tmp/cc4Z2xsf.o: In function `main':
quantlib-sample-1.cpp:(.text+0x1f): undefined reference to `QuantLib::Date::Date(int, QuantLib::Month, int)'
collect2: error: ld returned 1 exit status
The thing gets worse if i include "ql/quantlib.hpp" (much more errors like the one above). I tried passing "-L/usr/local/lib" for if my ldconfig is not ok.
I'm a bit lost here... Any clue?