[R] linking C/C++ external libraries.

Dirk Eddelbuettel edd at debian.org
Mon Dec 3 17:57:09 CET 2007

On 3 December 2007 at 14:54, Jarrod Hadfield wrote:
| I'm trying to load some C++ code using dyn.load but I'm getting  
| unresolved symbols associated with some external libraries  
| (CSparse).  I gather this is something to do with linking as the the  
| code compiles fine.  However, I've passed
| -L/home/jarrod/My_Programs/SuiteSparse/CSparse/Lib -lcsparse
| to the complier (g++), either directly using R CMD SHLIB or as  
| PKG_LIBS in a Makevars file, and I cannot resolve the problem.  I'm  
| working with R 2.6.0 on fedora 6
| Any help would be appreciated.

Can you show us your error message upon load?  What does ldd say when pointed
at your package's library?  How exactly is the linking done?

Compare all that to a working library such as eg Matrix. That may provide
further clues.

Hth, Dirk

Three out of two people have difficulties with fractions.

More information about the R-help mailing list