g++ errors when trying to compile c++11 with Rcpp
SYSTEM SPEC: OS - Mac OS X 10.6.8 (Snow Leopard) g++ - Macports gcc 4.8.1_2+universal R - 2.15.3 Rcpp - 0.10.3 I keep on receiving an error when I am trying to compile functions that use C++11 in R (through Rcpp) - for some reason, g++ does not recognise -std=c++11 option. This example is taken from Rcpp help files (it does not contain anything specific to C++11, but can show what my problem is). If I try running: require( Rcpp ) Sys.setenv( "PKG_CXXFLAGS"="-std=c++11" ) cppFunction(plugins=c("cpp11"), ' int useCpp11() { int x = 10; return x; }') I get: cc1plus: error: unrecognized command