Hello!
I have problems initializing alglib. At first i wanted to try out the spline1d_d_linear example and copied the code nearly exactly.
Code:
//#include <stdafx.h>
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
//#include <interpolation.h>
#include "C:/Qt/projects/MyProject/alglib/src/interpolation.h" //<--this is the path to the place where i put all the c++-files
using namespace alglib;
int main(int argc, char **argv)
{
//
// We use piecewise linear spline to interpolate f(x)=x^2 sampled
// at 5 equidistant nodes on [-1,+1].
//
real_1d_array x = "[-1.0,-0.5,0.0,+0.5,+1.0]";
real_1d_array y = "[+1.0,0.25,0.0,0.25,+1.0]";
double t = 0.25;
double v;
spline1dinterpolant s;
// build spline
spline1dbuildlinear(x, y, s);
// calculate S(0.25) - it is quite different from 0.25^2=0.0625
v = spline1dcalc(s, t);
printf("%.4f\n", double(v)); // EXPECTED: 0.125
return 0;
}
Like suggested in the manual I picked the packages I needed ... and added them to my project! Or do I need to install something first?
Anyway I get a lot of warnings like:
undefined reference to `alglib::real_1d_array::real_1d_array(char const*)'
and finally an error message that the linking went wrong.
I use:
OS:Windows Vista
Qt 4.5.2 (32 bit)
Compiler:MinGw
So what may be the problem?
Thanks for your help!