2016-08-24 1 views
-1

Ich bin neu in Rcpp. Ich suche Hilfe bei folgendem Problem. Es scheint, dass der RcppArmadillo nicht funktioniert. Könnte mir jemand Vorschläge machen? Vielen Dank!undefined Verweis auf 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/Replikation/src "-I" D:/R/Rcode/Replikation/inst/include "-I" d:/RCompile/r-Kompilierung/local/local323/include "-O2 -Wall -mtune = core2 -c test.cpp -o test.o

In Datei von D enthalten: /R/R-3.2.5/library/RcppProgress/include/progress.hpp: 13: 0, test.cpp aus: 7: D:/R/R-3.2.5/library/RcppProgress/include/interruptable_progress_monitor.hpp: 101: 0: Warnung: Ignorieren von #pragma omp kritisch [-Wunknown-pragmas]

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

D ignorieren:/R/R-3.2.5/library/RcppProgress/include/interruptable_progress_monitor.hpp: 153: 0: Warnung: Ignorieren #pragma omp kritisch [-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-kompilieren/lokal/local323/lib/x64 -Ld:/RCompile/r-kompilieren/lokal/local323/lib -LD: /R/R-32~1.5/bin/x64 -lR

Test .o: test.cpp :(. text + 0x61ee): undefined Verweisung auf `mvrnormArma (arma :: Col, arma :: Mat, int) '

test.o: test.cpp :(. text + 0x6d0e): undefined reference to `mvrnormArma (arma :: Col, arma :: Mat, int)‘

collect2: ld returned 1 exit status

+1

Nun, du ** ** unbedingt ** muss deinen Code enthalten, aber ich nehme an, du hast '// [[Rcpp :: depends (RcppArmadillo)]]' 'nicht in die Quelldatei geschrieben. – nrussell

+1

@nrussell: Es ist ein Link-Fehler, kein Kompilierfehler. Siehe meine Antwort unten. –

Antwort

3

, der wie ein faily gemeinsame und offensichtliche Fehler sieht der mit vergessen, zu aktualisieren src/Makefile, und hier src/Makefile.win, zu enthalten

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

so dass die erforderlich LAPACK und BLAS-Funktionalität ist da.

Für was es wert ist, wird dies auch hinzugefügt automatisch für Sie, wenn Sie beginnen, von RcppArmadillo.package.skeleton(), wie im Allgemeinen empfohlen wird.

+1

Danke für die perfekte Antwort. Entschuldigung für meinen blöden Fehler – Captain