jeudi 24 septembre 2015

Rstudio package development: Add -std=c++11 as compiler flag in Makevars

I am developing a project in Rstudio where I need to use C++11. So I wanted to specify the -std=c++11 compiler flag. I followd the R extensions manual, and have looked at other discussions (e.g this post). I put my Makefile in the src directory of my package, and this is what it contains:

PKG_CXXFLAGS = `-std=c++11` 

However, I continue to get the same error after compilation fails:

#error This file requires compiler and library support for the \
ISO C++ 2011 standard. This support is currently experimental, and must be \
enabled with the -std=c++11 or -std=gnu++11 compiler options.

Thanks for any tips.

Aucun commentaire:

Enregistrer un commentaire