<div dir="ltr">I couldn't reproduce this on Windows 7 with R 3.1 (which should have been using USE_CXX1X="yes" under the hood resulting in -std=c++0x passed to gcc).<div><br></div><div>However, I have this change which should make the cpp11 plugin automatically pass -std=c++0x when on R <= 3.0:</div>

<div><br></div><div><a href="https://github.com/RcppCore/Rcpp/pull/148" target="_blank">https://github.com/RcppCore/Rcpp/pull/148</a><br></div><div><br></div><div>Does that work for you? You can install with:</div><div><br>
</div><div>devtools::install_github("RcppCore/Rcpp", ref = "feature/windows-c++0x")<br>
</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Jun 5, 2014 at 3:36 AM, Gabor Grothendieck <span dir="ltr"><<a href="mailto:ggrothendieck@gmail.com" target="_blank">ggrothendieck@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">On Wed, Jun 4, 2014 at 11:21 PM, Dirk Eddelbuettel <<a href="mailto:edd@debian.org">edd@debian.org</a>> wrote:<br>

><br>
</div><div class="">> Rcpp 0.11.2 should be ready.<br>
><br>
> If anybody wants to jump in and do last minute testing, please do so now.<br>
><br>
> I ran two complete tests against CRAN last weekend, the results are<br>
> summarized as usual in the GitHub repo at<br>
><br>
>    <a href="https://github.com/RcppCore/rcpp-logs" target="_blank">https://github.com/RcppCore/rcpp-logs</a><br>
><br>
> Of 215 CRAN packages, all but 18 passed. Of those 18 a number where due to<br>
> package sirt not building because ... I use FC='ccache gfortran' which is not<br>
> gfortran so its configure failed. Grrr. I would pass next time.<br>
><br>
> Anyway, 195 packages passed just fine, so we should be good.  But if there is<br>
> something anyone of you would like to test, now would be a good time as I may<br>
> upload the current version to CRAN in the next few days unless I hear<br>
> objections.<br>
><br>
<br>
</div>There seems to be a problem using Rcpp::plugins("cpp11") on Windows<br>
8.1.  It gives the error:<br>
cc1plus.exe: error: unrecognized command line option '-std=c++11'<br>
<br>
I am using Rtools <a href="tel:3.1.0.1942" value="+13101942">3.1.0.1942</a> (which is the latest version) and for<br>
that it needs -std=c++0x or -std=gnu++0x<br>
<br>
If I remove the plugins line and instead issue this line first then it<br>
all works (except as per prior email I built Rcpp without vignettes to<br>
get around that problem):<br>
Sys.setenv("PKG_CXXFLAGS"="-std=c++0x") # for gcc 4.6.3<br>
<br>
> code <- '<br>
+ // [[Rcpp::plugins("cpp11")]]<br>
+<br>
+ #include <Rcpp.h><br>
+ #include <boost/range/irange.hpp><br>
+<br>
+ using boost::irange;<br>
+<br>
+ // [[Rcpp::depends(BH)]]<br>
+<br>
+ // [[Rcpp::export]]<br>
+ int useCpp11() {<br>
+     auto sum(0);<br>
+     for(const auto& i : irange(0,4)) { sum += i; }<br>
+     return sum;<br>
+ }<br>
+ '<br>
> library(Rcpp)<br>
> sourceCpp(code = code)<br>
g++ -m64 -I"C:/PROGRA~1/R/R-3.1/include" -DNDEBUG<br>
-I"C:/Users/Gabor/Documents/R/win-library/3.1/Rcpp/include"<br>
-I"C:/Users/Gabor/Documents/R/win-library/3.1/BH/include"<br>
-I"d:/RCompile/CRANpkg/extralibs64/local/include"  -std=c++11    -O2<br>
-Wall  -mtune=core2 -c file18a42f7f546e.cpp -o file18a42f7f546e.o<br>
cc1plus.exe: error: unrecognized command line option '-std=c++11'<br>
make: *** [file18a42f7f546e.o] Error 1 Warning message: running<br>
command 'make -f "C:/PROGRA~1/R/R-3.1/etc/x64/Makeconf" -f<br>
"C:/PROGRA~1/R/R-3.1/share/make/<a href="http://winshlib.mk" target="_blank">winshlib.mk</a>"<br>
SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' SHLIB_LD='$(SHLIB_CXXLD)'<br>
SHLIB="sourceCpp_83768.dll" WIN=64 TCLBIN=64<br>
OBJECTS="file18a42f7f546e.o"' had status 2<br>
Error in sourceCpp(code = code) :<br>
  Error 1 occurred building shared library.<br>
> useCpp11()<br>
Error: could not find function "useCpp11"<br>
> sourceCpp(code = code, verbose = TRUE)<br>
<br>
Generated extern "C" functions<br>
--------------------------------------------------------<br>
<br>
<br>
#include <Rcpp.h><br>
<br>
RcppExport SEXP sourceCpp_37333_useCpp11() {<br>
BEGIN_RCPP<br>
    SEXP __sexp_result;<br>
    {<br>
        Rcpp::RNGScope __rngScope;<br>
        int __result = useCpp11();<br>
        PROTECT(__sexp_result = Rcpp::wrap(__result));<br>
    }<br>
    UNPROTECT(1);<br>
    return __sexp_result;<br>
END_RCPP<br>
}<br>
<br>
Generated R functions<br>
-------------------------------------------------------<br>
<br>
`.sourceCpp_37333_DLLInfo` <-<br>
dyn.load('C:/Users/Gabor/AppData/Local/Temp/RtmpmUpJdX/sourcecpp_18a41e263c3c/sourceCpp_77519.dll')<br>
<br>
useCpp11 <- Rcpp:::sourceCppFunction(function() {}, FALSE,<br>
`.sourceCpp_37333_DLLInfo`, 'sourceCpp_37333_useCpp11')<br>
<br>
rm(`.sourceCpp_37333_DLLInfo`)<br>
<br>
Building shared library<br>
--------------------------------------------------------<br>
<br>
DIR: C:/Users/Gabor/AppData/Local/Temp/RtmpmUpJdX/sourcecpp_18a41e263c3c<br>
<br>
C:/PROGRA~1/R/R-3.1/bin/x64/R CMD SHLIB -o "sourceCpp_77519.dll"<br>
"file18a42f7f546e.cpp"<br>
g++ -m64 -I"C:/PROGRA~1/R/R-3.1/include" -DNDEBUG<br>
-I"C:/Users/Gabor/Documents/R/win-library/3.1/Rcpp/include"<br>
-I"C:/Users/Gabor/Documents/R/win-library/3.1/BH/include"<br>
-I"d:/RCompile/CRANpkg/extralibs64/local/include"  -std=c++11    -O2<br>
-Wall  -mtune=core2 -c file18a42f7f546e.cpp -o file18a42f7f546e.o<br>
cc1plus.exe: error: unrecognized command line option '-std=c++11'<br>
make: *** [file18a42f7f546e.o] Error 1<br>
Warning message:<br>
running command 'make -f "C:/PROGRA~1/R/R-3.1/etc/x64/Makeconf" -f<br>
"C:/PROGRA~1/R/R-3.1/share/make/<a href="http://winshlib.mk" target="_blank">winshlib.mk</a>"<br>
SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' SHLIB_LD='$(SHLIB_CXXLD)'<br>
SHLIB="sourceCpp_77519.dll" WIN=64 TCLBIN=64<br>
OBJECTS="file18a42f7f546e.o"' had status 2<br>
Error in sourceCpp(code = code, verbose = TRUE) :<br>
  Error 1 occurred building shared library.<br>
<div class="im HOEnZb"><br>
<br>
<br>
<br>
--<br>
Statistics & Software Consulting<br>
GKX Group, GKX Associates Inc.<br>
tel: 1-877-GKX-GROUP<br>
email: ggrothendieck at <a href="http://gmail.com" target="_blank">gmail.com</a><br>
</div><div class="HOEnZb"><div class="h5">_______________________________________________<br>
Rcpp-devel mailing list<br>
<a href="mailto:Rcpp-devel@lists.r-forge.r-project.org">Rcpp-devel@lists.r-forge.r-project.org</a><br>
<a href="https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel" target="_blank">https://lists.r-forge.r-project.org/cgi-bin/mailman/listinfo/rcpp-devel</a><br>
</div></div></blockquote></div><br></div>