<p>I tried this</p><p>## Use the R_HOME indirection to support installations of multiple R version<br>PKG_CPPFLAGS=-I/opt/boost_1_54_0/include -I../inst/include <br>PKG_LIBS=-L/opt/boost_1_54_0/lib -lboost_regex `$(R_HOME)/bin/Rscript -e "Rcpp:::LdFlags()"`</p><p>and this:</p><p> </p><p>## Use the R_HOME indirection to support installations of multiple R version<br>PKG_CPPFLAGS=-I/opt/boost_1_54_0/include -I../inst/include <br>PKG_LIBS = -L/opt/boost_1_54_0/lib -lboost_regex `$(R_HOME)/bin/Rscript -e "Rcpp:::LdFlags()"`</p><p> </p><p>Still got </p><p> </p><p>** testing if installed package can be loaded<br>Error in dyn.load(file, DLLpath = DLLpath, ...) : <br>  unable to load shared object '/home/amber/R/x86_64-redhat-linux-gnu-library/3.0/cpptest/libs/cpptest.so':<br>  /home/amber/R/x86_64-redhat-linux-gnu-library/3.0/cpptest/libs/cpptest.so: undefined symbol: _ZTIN4Rcpp7RObjectE<br>Error: loading failed<br>Execution halted<br>ERROR: loading failed<br>* removing ˇ®/home/amber/R/x86_64-redhat-linux-gnu-library/3.0/cpptestˇŻ<br>* restoring previous ˇ®/home/amber/R/x86_64-redhat-linux-gnu-library/3.0/cpptestˇŻ</p><p>Exited with status 1.<br></p><p> </p><div> </div><div><div><br></div><div><br></div><div style="padding: 2px 0px; font-family: Arial Narrow; font-size: 12px;">------------------ Original ------------------</div><div style="background: rgb(239, 239, 239); padding: 8px; font-size: 12px;"><div><b>From: </b> "Dirk Eddelbuettel"<edd@debian.org>;</div><div><b>Date: </b> Sep 4, 2013</div><div><b>To: </b> "guxiaobo1982"<guxiaobo1982@qq.com>; <wbr></div><div><b>Cc: </b> "Dirk Eddelbuettel"<edd@debian.org>; "rcpp-devel"<rcpp-devel@lists.r-forge.r-project.org>; <wbr></div><div><b>Subject: </b> Re: [Rcpp-devel] How to use external C++ libraries in R packages withRcpp.</div></div><div><br></div><br>On 4 September 2013 at 18:21, guxiaobo1982 wrote:<br>| Hi Dirk,<br>|  <br>| Thanks for you help, here is wha I got in a test package:<br>|  <br>| 1.Rcpp.package.skeleton("cpptest")<br><br>Good start!<br><br>| 2. Add the following line to Makevars<br>|  <br>| PKG_CPPFLAGS=-I/opt/boost_1_54_0/include -I../inst/include PKG_LIBS = -L/opt/<br>| boost_1_54_0/lib -lboost_regex `$(R_HOME)/bin/Rscript -e "Rcpp:::LdFlags()"`<br><br>Those have to be __two distinct lines__ not one glued together. Try<br><br>PKG_CPPFLAGS=-I/opt/boost_1_54_0/include -I../inst/include <br>PKG_LIBS = -L/opt/boost_1_54_0/lib -lboost_regex `$(R_HOME)/bin/Rscript -e "Rcpp:::LdFlags()"`<br><br>ie one assignment each to two variables PKG_CPPFLAGS and PKG_LIBS.<br><br>| 3. Change  rcpp_hello_world.cpp to this:<br><br>Looks good, and should work.  Boost Regex use is a nice small example.<br><br>Dirk<br><br>-- <br>Dirk Eddelbuettel | edd@debian.org | http://dirk.eddelbuettel.com<br>.<br></div>