我正在尝试在我的c ++项目中设置Armadillo。我有previolsy使用的代码块,但现在我想使用eclispse。我在eclipse中创建了一个新项目,并链接到openblas和lapack libs以及include文件夹,我将.dll文件放在与可执行文件相同的文件夹中。当我只创建一个简单的helloworld.cpp文件时它工作正常,但是当我将一堆其他的.cpp和.h(我的项目中的sourse和header-files从codeblocks)复制到我的项目中时,我收到此错误:< / p>
src \ BallJoint.o:在函数
gemv<double>': C:/Users/elias/Documents/eclipseCPP_test2/dombs/include/armadillo_bits/blas_wrapper.hpp:34: undefined reference to
wrapper_dgemv _&#39; src \ DombsMain.o:在函数asum<double>': C:/Users/elias/Documents/eclipseCPP_test2/dombs/include/armadillo_bits/blas_wrapper.hpp:239: undefined reference to
wrapper_dasum _&#39; src \ DombsMain.o:在函数nrm2<double>': C:/Users/elias/Documents/eclipseCPP_test2/dombs/include/armadillo_bits/blas_wrapper.hpp:271: undefined reference to
wrapper_dnrm2 _&#39; src \ DombsMain.o:在函数getrf<double>': C:/Users/elias/Documents/eclipseCPP_test2/dombs/include/armadillo_bits/lapack_wrapper.hpp:37: undefined reference to
wrapper_dgetrf _&#39; src \ DombsMain.o:在函数gesdd<double>': C:/Users/elias/Documents/eclipseCPP_test2/dombs/include/armadillo_bits/lapack_wrapper.hpp:583: undefined reference to
wrapper_dgesdd _&#39; src \ DombsMain.o:在函数gesv<double>': C:/Users/elias/Documents/eclipseCPP_test2/dombs/include/armadillo_bits/lapack_wrapper.hpp:643: undefined reference to
wrapper_dgesv _&#39; src \ DombsMain.o:在函数gels<double>': C:/Users/elias/Documents/eclipseCPP_test2/dombs/include/armadillo_bits/lapack_wrapper.hpp:677: undefined reference to
wrapper_dgels _&#39; src \ DombsMain.o:在函数getri<double>': C:/Users/elias/Documents/eclipseCPP_test2/dombs/include/armadillo_bits/lapack_wrapper.hpp:71: undefined reference to
wrapper_dgetri _&#39; src \ DombsMain.o:在函数gemm<double>': C:/Users/elias/Documents/eclipseCPP_test2/dombs/include/armadillo_bits/blas_wrapper.hpp:69: undefined reference to
wrapper_dgemm _&#39; src \ RotationMatrix.o:在函数syrk<double>': C:/Users/elias/Documents/eclipseCPP_test2/dombs/include/armadillo_bits/blas_wrapper.hpp:104: undefined reference to
wrapper_dsyrk _&#39; src \ RotationMatrix.o:在函数dot<double>': C:/Users/elias/Documents/eclipseCPP_test2/dombs/include/armadillo_bits/blas_wrapper.hpp:183: undefined reference to
wrapper_ddot _&#39; collect2.exe:错误:ld返回1退出状态
可能导致这种情况的原因是什么?
修改
我创建了一个新项目并尝试了这个代码,我得到了同样的错误。代码
arma::mat mm, mm2;
mm <<1<<1<<1;
mm2 <<1<<1<<1;
arma::mat mm3 = mm.t() * mm2;
mm3.print("h");
所以它抱怨矩阵乘法。