Skip to content
Prev 5409 / 10988 Next

[Rcpp-devel] Regular Expressions

On Sat, Mar 2, 2013 at 10:17 AM, Dirk Eddelbuettel <edd at debian.org> wrote:
Thanks. I doubled each backslash but unfortunately neither work.

I am able to build the original credit_card_example from the boost
site independently of Rcpp, i.e. this builds and I can run the result:

   rem this works
   C:\MinGW\set_distor_paths.bat
   g++ credit_card_example.cpp -o credit_card_example.exe -lboost_regex

and can also build C++ scripts not using boost; however,

all of the following give:
credit.cpp:6:27: fatal error: boost/regex.hpp: No such file or directory

   library(Rcpp)
   Sys.setenv("PKG_LIBS"="C:\\MinGW\\lib\\libboost_regex.a")
   sourceCpp("credit.cpp", verbose = TRUE)

   library(Rcpp)
   Sys.setenv("PKG_LIBS"="-LC:\\MinGW\\lib\\ -lboost_regex")
   sourceCpp("credit.cpp", verbose = TRUE)

   library(Rcpp)
   Sys.setenv("PKG_LIBS"="-lboost_regex")
   sourceCpp("credit.cpp", verbose = TRUE)

I also tried with Cygwin.  I have this file among others:
C:\cygwin\lib\libboost_regex-mt.dll.a

and tried these but they give the same result:

   library(Rcpp)
   Sys.setenv("PKG_LIBS"="C:\\cygwin\\lib\\libboost_regex-mt.dll.a")
   sourceCpp("credit.cpp", verbose = TRUE)

   library(Rcpp)
   Sys.setenv("PKG_LIBS"="-LC:\\cygwin\\lib\\ -lboost_regex")
   sourceCpp("credit.cpp", verbose = TRUE)

Changing backslash to forward slash does not change anything.

Everything was done with the svn version of Rcpp:
[1] '0.10.2.5'