title: Package with Rcpp code won't build on windows
body: <p>I'm not sure what I've done but I can't seem to get this package to build while it contains Rcpp code. I've installed MinGW appropriately (I think) and added it to my path (I think). </p>
  
  <p>Full disclosure, I hardly ever work on windows.</p>
  
  <p>When I try to build and reload, this is the error I get: </p>
  
  <pre><code>Warning: running command 'make -f "C:/PROGRA~1/R/R-32~1.4RE/etc/x64/Makeconf" -f "C:/PROGRA~1/R/R-32~1.4RE/share/make/winshlib.mk" SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' SHLIB_LD='$(SHLIB_CXXLD)' SHLIB="packagename.dll" WIN=64 TCLBIN=64 OBJECTS="RcppExports.o somefunC.o somefunC.o"' had status 127
  ERROR: compilation failed for package 'packagename'
  </code></pre>
  
  <p>Some basic things to check:</p>
  
  <pre><code>library(devtools)
  find_rtools() # TRUE
  has_devel()
  
  "C:/PROGRA~1/R/R-32~1.4RE/bin/x64/R" --no-site-file --no-environ  \
    --no-save --no-restore --quiet CMD SHLIB foo.c 
  
  gcc -m64 -I"C:/PROGRA~1/R/R-32~1.4RE/include" -DNDEBUG     -I"d:/RCompile/r-compiling/local/local323/include"     -O2 -Wall  -std=gnu99 -mtune=core2 -c foo.c -o foo.o
  gcc -m64 -shared -s -static-libgcc -o foo.dll tmp.def foo.o -Ld:/RCompile/r-compiling/local/local323/lib/x64 -Ld:/RCompile/r-compiling/local/local323/lib -LC:/PROGRA~1/R/R-32~1.4RE/bin/x64 -lR
  [1] TRUE
  </code></pre>
  
  <p>The system path variable on the computer: </p>
  
  <p>%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Brackets\command;C:\Program Files\nodejs\;C:\Program Files (x86)\Skype\Phone\;C:\MinGW\bin;C:\MinGW\msys\1.0\bin</p>
  
  <p>A couple of notes: </p>
  
  <ul>
  <li>In my descrition file I import Rcpp, and I added the link LinkingTo: Rcpp</li>
  <li>In my package documentation I have the <code>@useDynLib packagename</code> directive</li>
  <li>In my package I also have  <code>@importFrom Rcpp evalCpp</code></li>
  </ul>
  
  <p>Update: </p>
  
  <ul>
  <li>When I remove the src directory, the package does build.</li>
  <li><code>evalCpp("2+2")</code> works as expected</li>
  <li>Now that RBuildTools is on the path, I see a "pure virtual method" showing up when I restart R. </li>
  <li>I also get a new error message c:/Rtools/mingw_64/bin/g++; not found. This is interesting because Rtools is installed in a folder (that I did not choose) called RBuildTools and is in the path.</li>
  </ul>