安装R包时未定义的参考

时间:2017-10-05 13:46:56

标签: r g++ rcpp

我有一个私人R包,当我尝试安装时我得到错误,其中functInterp是我的包的名称

c:/Rtools/mingw_32/bin/g++ -shared -s -static-libgcc -o functInterp.dll tmp.def RcppExports.o empTraceVariogram.o empTraceVariogramTemp.o -Ld:/Compiler/gcc-4.9.3/local330/lib/i386 -Ld:/Compiler/gcc-4.9.3/local330/lib -LC:/PROGRA~1/R/R-34~1.2/bin/i386 -lR empTraceVariogramTemp.o:empTraceVariogramTemp.cpp:(.text+0x180):undefined reference to  dnrm2_'
  empTraceVariogram.o:empTraceVariogram.cpp:(.text+0x5bb): undefined
  reference todnrm2_' empTraceVariogram.o:empTraceVariogram.cpp:(.text+0x5f8): undefined reference to `ddot_'
在得到答案之后

C:/Users/utente/Documents/R/win-library/3.4/RcppArmadillo/include/armadillo_bits/compiler_setup.hpp:474:96: note: #pragma message: WARNING: use of OpenMP disabled; this compiler doesn't support OpenMP 3.0+
   #pragma message ("WARNING: use of OpenMP disabled; this compiler doesn't support OpenMP 3.0+")
                                                                                                ^
RcppExports.cpp:115:55: error: address of overloaded function with no contextual type information
     {"functInterp_empTraceCrossVariogram", (DL_FUNC) &functInterp_empTraceCrossVariogram, 8},

这是RcppArmadillo或函数的错误吗?

1 个答案:

答案 0 :(得分:0)

您的链接说明有误。从使用RcppArmadillo的软件包中查看任何src/Makevars.win并使用它:

## optional
#CXX_STD = CXX11

PKG_CXXFLAGS = $(SHLIB_OPENMP_CXXFLAGS) 
PKG_LIBS = $(SHLIB_OPENMP_CFLAGS) $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS)

其中$(SHLIB_OPENMP_CXXFLAGS)对您来说是可选的,但Armadillo现在想要它。