[Rcpp-devel] Installation tutorial for Rcpp, C++11, and 64-bit Windows

Gabor Grothendieck ggrothendieck at gmail.com
Sun Nov 24 16:44:56 CET 2013

On Sun, Nov 24, 2013 at 12:38 AM, Brian Templeton <mrme at inbox.com> wrote:
> I ended up spending a bit of time trying to get Rcpp to work for C++11 standard code in Windows. (I already had code working on Linux with Rcpp, but needed to get it to work with Windows as well.) I figured I'd write up what worked and post it on Rcpp list in case someone else has similar problems:
> http://batempleton.wordpress.com/2013/11/22/installing-rcpp-using-c11-on-windows-x64/

I also have some Windows batch files that can help with this, the main
benefit being that no enviornment variables or registry keys need to
be set for R or for Rtools (although it will use them if set).  A
secondary benefit is that they do not require Admin privileges since
they make no permanent changes to your system.

R.bat is a single self contained Windows batch file that can start
R.exe or Rgui.exe .  It looks up the location of R and Rtools using
the registry or if not found looks in standard locations.  It also
scans Rtools to discover the appropriate path to its directories. It
works by temporarily setting the required environment variables
eliminating the need to set any such variables yourself.

Using it installation of R is as simple as installing R and Rtools
using the defaults (they both have automated installers so this is
simple) and then placing R.bat anywhere on your path.  Running is just
a matter of using (1) 'R.bat' in place of 'R.exe' and (2) 'R.bat gui'
in place of 'Rgui.exe'.

They are available by downloading these two files (the second is the


On some systems its heuristic won't work and in that case use:


which is a simple batch file that can be edited manually (so its not
as automatic as R.bat but due to its simplicity you may have fewer
problems).  It also eliminates the need to set any environment
variables or to make other changes in the registry and is also
documented in the above md file.

Some of these installation simplifications are alternately provided in
some form in Rcpp itself as well as in the devtools and installr
packages.  These packages allow one to do this from within R whereas
these batch files work from the Windows cmd line.

In addition to the cited documentation there is some info on these and
other batch files on the home page:


More information about the Rcpp-devel mailing list