未定义参考RcppArmadillo

时间:2016-08-24 13:59:13

标签: r gcc rcpp

我是Rcpp的新手。我正在寻求以下问题的帮助。似乎RcppArmadillo不起作用。有人可以给我一些建议吗? 非常感谢!

  

g ++ -m64 -I“D:/R/R-32~1.5/include”-DNDEBUG -I“D:/R/R-3.2.5/library/Rcpp/include”-I“D:/ R / R-3.2.5 / library / RcppArmadillo / include“-I”D:/R/R-3.2.5/library/RcppProgress/include“-I”D:/ R / Rcode / Replicating / src“-I “D:/ R / Rcode / Replicating / inst / include”-I“d:/ RCompile / r-compiling / local / local323 / include”-O2 -Wall -mtune = core2 -c test.cpp -o test.o

     

在D:/ R/R-3.2.5/library/RcppProgress/include/progress.hpp:13:0中包含的文件中,                    来自test.cpp:7:   D:/R/R-3.2.5/library/RcppProgress/include/interruptable_progress_monitor.hpp:101:0:警告:忽略#pragma omp critical [-Wunknown-pragmas]

     

D:/R/R-3.2.5/library/RcppProgress/include/interruptable_progress_monitor.hpp:147:0:警告:忽略#pragma omp atomic [-Wunknown-pragmas]

     

D:/R/R-3.2.5/library/RcppProgress/include/interruptable_progress_monitor.hpp:153:0:警告:忽略#pragma omp critical [-Wunknown-pragmas]

     

g ++ -m64 -shared -s -static-libgcc -o sourceCpp_7.dll tmp.def test.o -LD:/ R/R-32~1.5/bin/x64 -lRlapack -LD:/ R / R- 32~1.5 / bin / x64 -lRblas -lgfortran -Ld:/ RCompile / r-compiling / local / local323 / lib / x64 -Ld:/ RCompile / r-compiling / local / local323 / lib -LD:/ R / R -32~1.5 / bin / x64 -lR

     

test.o:TEST.CPP :(文本+ 0x61ee):   未明确引用`mvrnormArma(arma :: Col,arma :: Mat,int)'

     

test.o:test.cpp :(。text + 0x6d0e):未定义的引用`mvrnormArma(arma :: Col,arma :: Mat,int)'

     

collect2:ld返回1退出状态

1 个答案:

答案 0 :(得分:6)

这似乎是忘记更新src/Makefile以及此处src/Makefile.win以包含

的一个常见而明显的错误
PKG_LIBS = $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS) 

这样所需的 LAPACK和BLAS功能就在那里。

如果您选择从RcppArmadillo.package.skeleton()开始按照通常的建议,也可以为您提供自动