【发布时间】:2012-04-27 10:22:11
【问题描述】:
您好,正如 README.txt 所述,我在自己的工作目录 /home/me/package/armadillo3.0.1/ 中安装了 Armadillo3.0.1。但是当我尝试一个例子时:
g++ -I /home/me/package/armadillo3.0.1/usr/include/example.cpp -o example -O1
它总是显示错误:
/tmp/ccZAE9pj.o:在函数
void arma::gemm<false, false, false, false>::apply_blas_type<double>(arma::Mat<double>&, arma::Mat<double> const&, arma::Mat<double> const&, double, double)': example.cpp:(.text._ZN4arma4gemmILb0ELb0ELb0ELb0EE15apply_blas_typeIdEEvRNS_3MatIT_EERKS5_S8_S4_S4_[void arma::gemm<false, false, false, false>::apply_blas_type<double>(arma::Mat<double>&, arma::Mat<double> const&, arma::Mat<double> const&, double, double)]+0x75e): undefined reference towrapper_dgemm_' /tmp/ccZAE9pj.o:在函数void arma::glue_times_redirect2_helper<true>::apply<arma::Mat<double>, arma::Mat<double> >(arma::Mat<arma::Mat<double>::elem_type>&, arma::Glue<arma::Mat<double>, arma::Mat<double>, arma::glue_times> const&)': example.cpp:(.text._ZN4arma27glue_times_redirect2_helperILb1EE5applyINS_3MatIdEES4_EEvRNS3_INT_9elem_typeEEERKNS_4GlueIS5_T0_NS_10glue_timesEEE[void arma::glue_times_redirect2_helper<true>::apply<arma::Mat<double>, arma::Mat<double> >(arma::Mat<arma::Mat<double>::elem_type>&, arma::Glue<arma::Mat<double>, arma::Mat<double>, arma::glue_times> const&)]+0xe69): undefined reference towrapper_dgemv_' example.cpp :(。text._ZN4arma27glue_times_redirect2_helperILb1EE5applyINS_3MatIdEES4_EEvRNS3_INT_9elem_typeEEERKNS_4GlueIS5_T0_NS_10glue_timesEEE [空隙ARMA :: glue_times_redirect2_helper ::申请,ARMA ::垫>(ARMA ::垫:: elem_type>&,ARMA ::胶,ARMA ::垫,ARMA :: glue_times> const&)]+0x1175): 未定义的对 `wrapper_dgemv_' 的引用 collect2: ld 返回 1 个退出状态
但是,如果我添加 -larmadillo 选项,例如:
g++ example.cpp -o example -O1 -larmadillo
它通过调用旧版本来工作。如果我想使用 Mat.t() 之类的 3.0.1 中的新功能,它也会显示错误:
example.cpp:在函数“int main(int, char**)”中: example.cpp:20:错误:“struct arma::mat”没有名为“t”的成员
这表明通过添加-larmadillo,它从/usr/include/armadillo_bits/调用旧版本的犰狳。
你知道吗?谢谢。
【问题讨论】:
标签: c++ g++ installation armadillo