请问我第一次使用正则表达式获得Rcpp的经验吗? 我试图复制gallery example,但不幸的是我收到了错误。以下是我的尝试方式。 首先,我创建了test.cpp文件并粘贴了上面示例中的内容。 其次,我使用以下内容创建了test.R文件:
library(Rcpp)
Sys.setenv("PKG_LIBS"="-lboost_regex")
sourceCpp('test.cpp')
最后,当我运行test.R程序时,它会给出ERROR:
c:/Rtools/mingw_64/bin/g++ -I"C:/Users/manukyae/DOCUME~1/R/R-34~1.3/include" -DNDEBUG -I"C:/Users/manukyae/Documents/R/R-3.4.3/library/Rcpp/include" -I"C:/Users/manukyae/DOCUME~1/RWORK~1/UHOSTJ~1" -O2 -Wall -mtune=generic -c test.cpp -o test.o
test.cpp:6:27: fatal error: boost/regex.hpp: No such file or directory
#include <boost/regex.hpp>
^
compilation terminated.
make: *** [test.o] Error 1
Warning message:
running command 'make -f "C:/Users/manukyae/DOCUME~1/R/R-34~1.3/etc/x64/Makeconf" -f "C:/Users/manukyae/DOCUME~1/R/R-34~1.3/share/make/winshlib.mk" SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' SHLIB_LD='$(SHLIB_CXXLD)' SHLIB="sourceCpp_6.dll" WIN=64 TCLBIN=64 OBJECTS="test.o"' had status 2
Error in sourceCpp("test.cpp") :
Error 1 occurred building shared library.