[Rcpp-devel] Rcpp/ Boost linking problem

Diego Monteiro dvm1607 at gmail.com
Wed Sep 9 23:32:42 CEST 2015


Thank you very much for the answers.

I was finally able to solve my problem. PKG_LIBS was the solution, I just
thought since release 0.11 I wouldn’t be able to use Makevars any more, I
misread it.

Again Thank you very much for the answers.

2015-09-09 18:19 GMT-03:00 Steven McKinney <smckinney at bccrc.ca>:

> Have you tried setting flags in HOME/.R/Makevars as described in
>
>
>
> https://cran.r-project.org/doc/manuals/R-admin.html#Customizing-package-compilation
>
>
> Depending on your operating system version, there are some variants for
> HOME/.R/Makevars file naming, described in the R Admin manual, so give that
> a careful read and see if that lets you accomplish your compilation and
> linking.
>
>
>
> Best
>
>
> Steven McKinney
>
>
> Statistician
> Molecular Oncology and Breast Cancer Program
> British Columbia Cancer Research Centre
>
>
> ________________________________
> From: rcpp-devel-bounces at lists.r-forge.r-project.org <
> rcpp-devel-bounces at lists.r-forge.r-project.org> on behalf of Diego
> Monteiro <dvm1607 at gmail.com>
> Sent: September 9, 2015 1:55 PM
> To: rcpp-devel at lists.r-forge.r-project.org
> Subject: [Rcpp-devel] Rcpp/ Boost linking problem
>
> Good Evening.
>
> I am pretty new to this programming universe, but I was given a task to
> create an R/C++ package.
>
> I am trying to link a third-party library to my R/C++ code using Rcpp
> 0.12.0 , I have successfully used other third party libraries on my R/C++,
> but when I try to use this one that uses boost my R gives me the following
> error:
>
> ** testing if installed package can be loaded
> Error in dyn.load(file, DLLpath = DLLpath, ...) :
>   unable to load shared object
> '/home/diego/R/x86_64-pc-linux-gnu-library/3.2/TesteTerralib/libs/TesteTerralib.so':
>
> /home/diego/R/x86_64-pc-linux-gnu-library/3.2/TesteTerralib/libs/TesteTerralib.so:
> undefined symbol: _ZN5boost6system15system_categoryEv
> Error: loading failed
> Execution halted
> ERROR: loading failed
>
>
> I have boost 1.59.0 installed, but apparently it could not be linked.
> Searching online I have found that maybe adding the flag -lboost_system to
> the g++ it would work, but I don't know how to add this flag when using
> RStudio nor just R in the terminal. Could anybody tell me what should I do?
>
> Best Regards
> Diego.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20150909/088d78cb/attachment.html>


More information about the Rcpp-devel mailing list