Can I use self-defined Rcpp function in RStan?

Very much appreciate if you can give some suggestion on how to use self-defined Rcpp function within Rstan.

https://cran.r-project.org/web/packages/rstan/vignettes/external.html