On 12 July 2013 at 21:35, Jules Archer wrote: | Krzysztof, | | Thank you very much for your helpful reply. | | Along with your suggestions, I was finally able to track down the problem. As | it turned out, I was (incorrectly) re-defining PKG_LIBS instead of adding to | the already existing | PKG_LIBS = `$(R_HOME)/bin/Rscript -e "Rcpp:::LdFlags()"` in the Makevars file. | With this fix, the binary package build is successful.
Yup, that'll do it. And again, there are many Rcpp-based packages linking to external libraries so there is always a stanza to copy from. | Thanks again to you and Dirk for your help! Glad it works for you. Looking forward to your package. Dirk | ------------------------------------------------------------------------------- | From: Krzysztof Sakrejda <krzysztof.sakre...@gmail.com> | To: Jules Archer <jules.arc...@ymail.com> | Cc: Dirk Eddelbuettel <e...@debian.org>; | "rcpp-devel@lists.r-forge.r-project.org" | <rcpp-devel@lists.r-forge.r-project.org> | Sent: Wednesday, July 10, 2013 11:36 AM | Subject: Re: [Rcpp-devel] Unable to load shared object | | On Wed, Jul 10, 2013 at 2:18 PM, Jules Archer <jules.arc...@ymail.com> wrote: | | > | However, when I try to compile as an R package, I keep getting the | > following | > | error: | > | | > | ** building package indices | > | ** testing if installed package can be loaded | > | Error in dyn.load(file, DLLpath = DLLpath, ...) : | > | unable to load shared object '/usr/local/lib/R/site-library/mathGL/libs/ | > | mathGL.so': | > | /usr/local/lib/R/site-library/mathGL/libs/mathGL.so: undefined symbol: | > | _ZTIN4Rcpp14not_compatibleE | | I don't have an immediate answer, but calling c++filt gets you: | | ~ $ c++filt _ZTIN4Rcpp14not_compatibleE | typeinfo for Rcpp::not_compatible | | I get more helpful error messages when I add "-Wl,-z,defs" to the gcc | flags when building the library. With those flags, the error comes up | at compilation. The proximate cause of the error is that it can't | find the Rcpp::not_compatible exception class... the next clue you | need is probably to look at the lines of output where your library is | actually being compiled to see how Rcpp is being included, that's the | part that's failing. Sorry if this is all obvious, I can't tell from | your post where you're at with the Rcpp/C++ combo. | | Hope that helps, | | Krzysztof | | | -- | | Krzysztof Sakrejda | | Organismic and Evolutionary Biology | University of Massachusetts, Amherst | 319 Morrill Science Center South | 611 N. Pleasant Street | Amherst, MA 01003 | | work #: 413-325-6555 | email: sakre...@cns.umass.edu | ----------------------------------------------- | | -- Dirk Eddelbuettel | e...@debian.org | http://dirk.eddelbuettel.com _______________________________________________ Rcpp-devel mailing list Rcpp-devel@lists.r-forge.r-project.org https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel