On 19 November 2009 at 20:57, David Scherrer wrote:
| I don't bring my head around how to link an external C++ library with some R
| code using R CMD SHLIB and/or R CMD INSTALL .
| 
| So does anybody can tell me how I could easily link an external library that
| is e.g. in
| /usr/local/lib/mMyLibrary ?

Prefix 'R CMD SHLIB ...' with settings for PKG_LIBS and/or PKG_CPPFLAGS
and/or PKG_CXXFLAGS:

    $ PKG_LIBS="-L/usr/local/lib/mMyLibrary -lsomelibrary" \
      PKG_CPPFLAGS="-I... -Wall" \          
      R CMD SHLIB foo.cpp  

on the command-line, or if that is too fiddly, create a package. There are
literally dozens of packages on CRAN (and R-Forge) to copy from.  

Dirk
                                        
-- 
Three out of two people have difficulties with fractions.

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to