title: Run in R system ('g++ ...') got error 217
body: <p>I am trying to compile a <code>.cpp</code> file created by someone else in R on a Windows computer by running the following code:</p>
  
  <pre><code>system("g++ C:\\Users\\uos\\Documents\\R\\win-library\\3.2\\TimeShift\\data\\dtw.cpp -o C:\\Users\\uos\\Documents\\R\\win-library\\3.2\\TimeShift\\data\\dtw")
  </code></pre>
  
  <p>and I get </p>
  
  <blockquote>
    <p>error code 217</p>
  </blockquote>
  
  <p>I have tried the following solutions:</p>
  
  <ol>
  <li><p>use <code>system2</code> instead of <code>system</code> </p></li>
  <li><p>use </p>
  
  <pre><code>setwd(C:\\Users\\uos\\Documents\\R\\win-library\\3.2\\TimeShift\\data)
  system2('g++ dtw.cpp -o dtw')
  </code></pre></li>
  </ol>
  
  <p>and they both give me </p>
  
  <blockquote>
    <p>error 217</p>
  </blockquote>
  
  <p>I have checked the path to the dtw and it is correct as well as installing the <code>Rcpp</code> package. I had a look on the <code>dtw.cpp</code> file and it seems OK. I do not know what else I could do. </p>