[Rcpp-devel] Are there any C++ function name restrictions?

Dirk Eddelbuettel edd at debian.org
Thu May 30 03:06:07 CEST 2013


Asis,

It works fine here:

edd at don:/tmp/foobar$ rm src/*.o src/*.so
edd at don:/tmp/foobar$ grep Tables src/* R/*
src/rcpp_hello_world.cpp:RcppExport SEXP conditionalProbabilityTables(){
src/rcpp_hello_world.h:RcppExport SEXP conditionalProbabilityTables() ;
R/rcpp_hello_world.R:		  .Call( "conditionalProbabilityTables",
PACKAGE = "foobar" )
edd at don:/tmp/foobar$ R CMD INSTALL .
* installing to library ‘/usr/local/lib/R/site-library’
* installing *source* package ‘foobar’ ...
** libs
ccache g++ -I/usr/share/R/include -DNDEBUG
-I"/usr/local/lib/R/site-library/Rcpp/include"   -fpic  -O3 -g0 -Wall
-pedantic -pipe  -c rcpp_hello_world.cpp -o rcpp_hello_world.o
ccache g++ -shared -o foobar.so rcpp_hello_world.o
-L/usr/local/lib/R/site-library/Rcpp/lib -lRcpp
-Wl,-rpath,/usr/local/lib/R/site-library/Rcpp/lib -L/usr/lib/R/lib -lR
installing to /usr/local/lib/R/site-library/foobar/libs
** R
** preparing package for lazy loading
** help
Warning: /tmp/foobar/man/foobar-package.Rd:31: All text must be in a section
Warning: /tmp/foobar/man/foobar-package.Rd:32: All text must be in a section
*** installing help indices
** building package indices
** testing if installed package can be loaded
* DONE (foobar)
edd at don:/tmp/foobar$ Rscript -e 'library(foobar); print(rcpp_hello_world())'
Loading required package: Rcpp
[[1]]
[1] "foo" "bar"

[[2]]
[1] 0 1

edd at don:/tmp/foobar$ 


You really don't want to check in .o and .so files.  It may have been as
simple as you not recompiling before running install.  _Always_ clean, a
script like

   #!/bin/bash

   rm -f src/*.o src/*.so

may help.

Dirk

-- 
Dirk Eddelbuettel | edd at debian.org | http://dirk.eddelbuettel.com


More information about the Rcpp-devel mailing list