views:

383

answers:

2

I'm trying to use an open source library http://arma.sourceforge.net for linear algebra calculations. Some of the functions in Armadillo like pinv use LAPACK. I've written a very simple piece of code to use Armadillo to calculate pinv, but it produces a runtime error. This is probably because I do not have LAPACK linker flags in the sln file.

#include <iostream>

#include "armadillo"

using namespace arma;
using namespace std;


int main(int argc, char** argv)
  {

 mat A = rand<mat>(4,5);
 mat pinverse = pinv(A); 
 A.print("A=");
 return 0;

  }
A: 

First things first, do you have LAPACK library? If not, get one (there's a number of implementations to choose). Otherwise, check that library's documentation or readme. There's nothing specific to Visual C++ here.

Usually all that's needed is: add "lapack.lib" to linker input (in project settings).

ima
i got LAPACK 3.1.1 for Windows , but doesn't work
iceman
I updated answer with obvious lib file, otherwise - can't help, there must be something unusual about your situation. Try clean installation on a different PC if you can.
ima
iceman
A: 

Can somebody help me please. I had the same problem like him, but then i updated the armadillo files and the example compiles perfektly.

now i wanted to add the armadillo to my projekt. but i cannot compile it. no way. i tried everything. there always coming error like syntaxerror for running_stat_vec_proto.hpp and fn_min.hpp

does anybody now how to set up the armadillo functionality to a new project in visual studio ?

thanks

Curru