Hello everybody. I am new here and I just started experimenting with this library. There seem to be a lot of great function included but i struggle to get it running properly. Following chunk of code:
#include "StdAfx.h" #include <windows.h> #include "fundamental.h" #include "matrix.h" #include <cmath>
#include "ap.h" #include "linalg.h" #include "alglibinternal.h"
#include <iostream> #include <fstream> #include <cstdlib>
. . .
count =12; alglib::real_2d_array a; a.setlength(count,9) ;
for ( int i = 0; i < count; i++ ) { for ( int j = 0; j < 9; j++ ) { a(i,j) = mat[i][j]; } }
alglib::ae_int_t m=count; alglib::ae_int_t n=9; alglib::ae_int_t uneeded=2; alglib::ae_int_t vtneeded=2; alglib::ae_int_t additionalmemory=2; alglib::real_1d_array w; alglib::real_2d_array u; alglib::real_2d_array vt; alglib::rmatrixsvd(a,m,n,uneeded,vtneeded,additionalmemory,w,u,vt);
. . .
Gives me linker errors:
Error 14 fatal error LNK1120: 9 unresolved externals
for instance :
Error 7 error LNK2001: unresolved external symbol "void __clrcall alglib_impl::hqrndunit2(struct alglib_impl::hqrndstate *,double *,double *,struct alglib_impl::ae_state *)" (?hqrndunit2@alglib_impl@@$$FYMXPAUhqrndstate@1@PAN1PAUae_state@1@@Z) linalg.obj
All these errors comes from linalg.obj as mentioned in output window.
I am using visual studio 2008 , c++ , where i added ap.h, linalg.h,alglibinternal.h and ap.cpp, linalg.cpp,alglibinternal.cpp to my project (right click header files -> add->existing file ... ). Is there some other step that I am forgetting about?
|