0

I'm trying to compile a test program using Visual Studio 2012 written in C++, the program computes the inverse of an arbitrary matrix using the Armadillo linear algebra library. This requires that you enable LAPACK in Armadillo's config.h file and link to the libraries/dlls in the project's properties (which I've done).

I'm compiling for a 64bit release so I've downloaded the suitable BLAS/LAPACK libraries from here and have linked the VS project against them. Having done all this I'm still getting link errors whilst trying to use Armadillo's inv(...) method as follows:

1>Matrix.obj : error LNK2019: unresolved external symbol dgetrf_ referenced in function "public: static double __cdecl arma::auxlib::det_lapack<double>(class arma::Mat<double> const &,bool)" (??$det_lapack@N@auxlib@arma@@SANAEBV?$Mat@N@1@_N@Z)
1>Matrix.obj : error LNK2019: unresolved external symbol dgetri_ referenced in function "void __cdecl arma::lapack::getri<double>(long *,double *,long *,long *,double *,long *,long *)" (??$getri@N@lapack@arma@@YAXPEAJPEAN00100@Z)

Can anyone give me a slight indication as to what I'm doing wrong? Many thanks in advance!

Ulrich Eckhardt
  • 16,572
  • 3
  • 28
  • 55
Will Andrew
  • 693
  • 1
  • 10
  • 29

1 Answers1

1

The examples provided with Armadillo should compile out of the box. Open the project files in the examples/example1_win32 folder. You may want to simply use them as a starting point for your code.

Alternatively, this site might be useful: Armadillo with BLAS and LAPACK in 64 bit Visual C++ projects

Using 64 bit LAPACK and BLAS is considerably faster than the 32 bit versions. You may also want to look into using Intel MKL, which provides high-speed multi-core implementation of LAPACK.

mtall
  • 3,574
  • 15
  • 23
  • Thanks, the example projects compile successfully but the executable doesn't run `Unable to start program ...example1_win32.exe. The system file cannot find the file specified`. Thanks for the link, I'll see if it works – Will Andrew Aug 16 '13 at 08:11
  • Following that step-by-step guide worked, thank you very much! – Will Andrew Aug 16 '13 at 08:45