I currently have a .cpp file that I can compile using sourceCpp(). As expected the corresponding R function is created and the code works as expect
.cpp
sourceCpp()
In short, the trick is to call compileAttributes() from within the root of the package. So for instance for package foo
compileAttributes()
foo
$ cd /path/to/foo $ ls DESCRIPTION man NAMESPACE R src $ R R> compileAttributes()
This command will generate the RcppExports.cpp and RcppExports.R that were missing.
RcppExports.cpp
RcppExports.R