2016-08-24 2 views
-1

Rcpp를 처음 사용합니다. 다음 문제에 대한 도움을 찾고 있습니다. RcppArmadillo가 작동하지 않는 것 같습니다. 누군가 제안 해 줄 수 있습니까? 많은 감사!정의되지 않은 참조 RcppArmadillo

그램 ++ -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- 컴파일/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/라이브러리/RcppProgress/include/interruptable_progress_monitor.hpp : 101 : 0 : 경고 : #pragma omp critical 무시 -Wunknown-pragmas

백45경1천5백15조5백36억9천1백36만3천2백10

D : /R/R-3.2.5/library/RcppProgress/include/interruptable_progress_monitor.hpp 147 : 0 :주의 :의 #pragma 무시 원자 [-Wunknown - 프라 그마]

D를 OMP/R/R-3.2.5/라이브러리/RcppProgress/include/interruptable_progress_monitor.hpp : 153 : 0 경고 : ignore #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 -lRapap -LD : /R/R-32~1.5/bin/x64 -lRblas -lgfortran -Ld :/RCompile/r- 컴파일/local/local323/lib/x64 -Ld :/RCompile/r- 컴파일/local/local323/lib -LD : /R/R-32~1.5/bin/x64 -l

테스트 .0 : test.cpp :(. 텍스트 + 0x61ee) : 'mvrnormArma (arma :: Col, arma :: Mat, int)'에 대한 정의되지 않은 참조 '

test.o : test.cpp : 0x6d0e) : mvrnormArma (ARMA : 골, ARMA : 매트, INT) ''에 대한 정의되지 않은 참조는

collect2 : ld에 반환 한 출구 가진의 faily 일반적이고 명백한 오류처럼 보이는 상태

+1

음 ** 분명히 ** 코드를 포함해야하지만 소스 파일에 // [[Rcpp :: depends (RcppArmadillo)]]'를 넣지 않았다고 추측합니다. – nrussell

+1

@nrussell : 링크 오류이며 컴파일 오류가 아닙니다. 아래 내 대답을 참조하십시오. –

답변

3

src/Makefile을 업데이트하는 것을 잊어 버렸고 여기에

PKG_LIBS = $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS) 

이므로 LAPACK 및 BLAS 기능이 필요합니다.

일반적으로 RcppArmadillo.package.skeleton()에서 시작하는 것으로 선택하면이 내용이 자동으로 번으로 추가됩니다.

+1

완벽한 답변 주셔서 감사합니다. 내 바보 같은 실수로 미안해. – Captain