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

Asis Hallab asis.hallab at gmail.com
Thu May 30 11:50:36 CEST 2013

Dear Dirk, Dale and Rcpp advisors,

thank you very much for your help.

Finally with your help the source of my problem could be identified.
It was the way I reloaded the newly build and changed package.
Searching the web I had found the following R command sequence to
reload a package:

detach( 'package:foobar', unload=TRUE )
require( 'foobar' )

After detaching my package my function was not available any more:

> rcpp_hello_world()
Error: could not find function "rcpp_hello_world"

So I concluded that the package had been unloaded successfully.

But, somehow the background C/C++ functions had not been completely unloaded.
Such that after changing the Rcpp function "rccp_hello_world" to
rebuilding my changed package, and finally requiring it in my _already
open_ interactive R shell,
I got the error

> rcpp_hello_world()
Error in .Call("conditionalProbabilityTables", PACKAGE = "foobar") :
"conditionalProbabilityTables" not available for .Call() for package "foobar"

Hopefully this threat helps any other newby besides myself to overcome
a similar problem.

Anyway I have another question now.

Vim is my editor of choice which I use together with its fantastic
plugin "syntastic",
which in turn automatically does a syntax check whenever a file is
loaded or saved.

When saving my Rccp file it gives me some errors:
Rcpp.h: No such file or directory
RcppExport does not name a type

I guess it is missing entries in any one of these environment variables

So which one do I have to set to make the standard C make work and
how do I know the path to the Rcpp and OpenMP libraries?

I am convinced that this again is pretty stupid greenhorn question,
in any case I'd be much obliged to get any help on this one.

Kind regards,
many thanks for the help offered so far

More information about the Rcpp-devel mailing list