Я пытаюсь создать пакет R, который является оберткой вокруг библиотеки C (и которая использует gsl) в Windows. Я могу перейти на Linux, если необходимо К лучшему или худшему, я помещаю команды make для библиотеки C в Makevars.in. Я использовал функцию Rcpp Rstudio для создания пакета. Я установил Rtools 3.3 и использовал R 3.3.1Неопределенные ссылки при использовании Rcpp
и я включил Rcpp и RcppGSL в поле LinkingTo ОПИСАНИЕ. Я до сих пор получаю неопределенные эталонные ошибки для команды макияжа
$(CXX) $(CXXFLAGS) $(OBJECTS) ../inst/libgraphm.a $(PKG_LIBS)
Некоторых ошибок является
c:/Rtools/mingw_64/bin/g++ -shared -s -static-libgcc -o RGraphM.dll tmp.def graphmatch_rcpp.o RcppExports.o -L../inst -lgraphm -LC:/tools/gsl/lib/x64 -lgsl -lgslcblas -Ld:/Compiler/gcc-4.9.3/local330/lib/x64 -Ld:/Compiler/gcc-4.9.3/local330/lib -LC:/PROGRA~1/R/R-33~1.1/bin/x64 -lR
#cd graphm && /usr/bin/make
c:/Rtools/mingw_64/bin/g++ -O2 -Wall -mtune=core2 graphmatch_rcpp.o RcppExports.o ../inst/libgraphm.a -L../inst -lgraphm -LC:/tools/gsl/lib/x64 -lgsl -lgslcblas
graphmatch_rcpp.o: In function `PreserveStorage':
C:/Users/sadali/Documents/R/win-library/3.3/Rcpp/include/Rcpp/storage/PreserveStorage.h:10: undefined reference to `__imp_R_NilValue'
graphmatch_rcpp.o: In function `Vector':
C:/Users/sadali/Documents/R/win-library/3.3/Rcpp/include/Rcpp/vector/Vector.h:58: undefined reference to `Rf_allocVector'
graphmatch_rcpp.o: In function `Rcpp_ReplaceObject':
Ответ на этот вопрос похож (в моих глазах) вопрос кажется неприменимой Undefined reference errors when including Rcpp.h как я использую LinkingTo и пытаюсь создать пакет R
Редактировать: в качестве первого ответа я попытался построить RcppZiggurat со следующим Makevars.win:
PKG_CPPFLAGS = -I. -I../inst/include -IC:/tools/gsl/include
## Use the R_HOME indirection to support installations of multiple R version
PKG_LIBS = $(LDFLAGS) -L../inst -L$(LIB_GSL)/lib/x64 $(shell "${R_HOME}/bin${R_ARCH_BIN}/Rscript.exe" -e "RcppGSL:::LdFlags()")
Я получаю эти ошибки.
ziggurat.o:ziggurat.cpp:(.text+0x86): undefined reference to `gsl_rng_free'
ziggurat.o:ziggurat.cpp:(.text+0xa6): undefined reference to `gsl_rng_free'
ziggurat.o:ziggurat.cpp:(.text+0xc6): undefined reference to `gsl_rng_free'
ziggurat.o:ziggurat.cpp:(.text+0x1254): undefined reference to `gsl_rng_set'
первые полезные строки из 'graphmatch_rcpp.cpp' были бы полезны, но [это] (http://stackoverflow.com/questions/8061254/calling-r-function-from-c-on-windows) может быть вашим выпуск – hrbrmstr