我想使用Rcpp库创建我的R包,但即使使用该示例我也遇到了一些问题。
我跑
Rcpp.package.skeleton( “foobar的”)
但是当我尝试编译/检查R包时,我有以下错误:
==> devtools::check(document = FALSE)
Setting env vars ---------------------------------------------------------------
CFLAGS : -Wall -pedantic
CXXFLAGS: -Wall -pedantic
Building foobar ----------------------------------------------------------------
"C:/PROGRA~1/R/R-32~1.3/bin/x64/R" --no-site-file --no-environ --no-save \
--no-restore --quiet CMD build "C:\Users\scacciat\Desktop\foobar" \
--no-resave-data --no-manual
* checking for file 'C:\Users\scacciat\Desktop\foobar/DESCRIPTION' ... OK
* preparing 'foobar':
* checking DESCRIPTION meta-information ... OK
* cleaning src
* installing the package to process help pages
-----------------------------------
* installing *source* package 'foobar' ...
** libs
g++ -m64 -I"C:/PROGRA~1/R/R-32~1.3/include" -DNDEBUG -I"\\icnas4.cc.ic.ac.uk/scacciat/R/win-library/3.2/Rcpp/include" -I"d:/RCompile/r-compiling/local/local323/include" -O2 -Wall -mtune=core2 -c RcppExports.cpp -o RcppExports.o
RcppExports.cpp:4:18: fatal error: Rcpp.h: No such file or directory
compilation terminated.
make: *** [RcppExports.o] Error 1
Warning: running command 'make -f "C:/PROGRA~1/R/R-32~1.3/etc/x64/Makeconf" -f "C:/PROGRA~1/R/R-32~1.3/share/make/winshlib.mk" SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' SHLIB_LD='$(SHLIB_CXXLD)' SHLIB="foobar.dll" WIN=64 TCLBIN=64 OBJECTS="RcppExports.o rcpp_hello_world.o"' had status 2
ERROR: compilation failed for package 'foobar'
* removing 'C:/Users/scacciat/AppData/Local/Temp/Rtmpkvl6Bo/Rinst116c227323e9/foobar'
-----------------------------------
ERROR: package installation failed
Warning: running command '"C:/PROGRA~1/R/R-32~1.3/bin/x64/Rcmd.exe" INSTALL -l "C:\Users\scacciat\AppData\Local\Temp\Rtmpkvl6Bo\Rinst116c227323e9" --no-multiarch "C:/Users/scacciat/AppData/Local/Temp/Rtmpkvl6Bo/Rbuild116c5035785/foobar"' had status 1
Error: Command failed (1)
Execution halted
Exited with status 1.
```