We may need to see the code, or a mocked up version.
When you use the compileAttributes()
function to compile an Rcpp function---be it by pressing the button in RStudio, or explicitly---it creates additonal code around your code sample (essentially dealing with data conversion etc).
I think I may have seen that error when I did something silly like not including a correct return statement.
Edit based on Ian's comment: This works for me (with manual line break here for SO)
R> cppFunction("IntegerVector fastswap(const NumericMatrix x, const int p, \
const IntegerVector S_init, const IntegerVector fixed_in, \
const IntegerMatrix order) { return S_init; }")
R> str(fastswap)
function (x, p, S_init, fixed_in, order)
R>
So you may have a problem with your computer setup. But as there is little reproducible here nobody can say for sure.