I have a cpp file that defines c++ and R functions, which are sourced into R using Rcpp::sourceCpp().
cpp
c++
R
Rcpp::sourceCpp()