Question

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!

Était-ce utile?

La solution

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.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top