title: Error in inline
body: <pre><code>require(inline)
  require(Rcpp)
  
  sig &lt;- signature(a="NumericVector", b="NumericVector", N="int")
  body &lt;- 'int i=0;
    double somme=0.0;
    for (i=0;i &lt; N ;i++){
      if (a[i] &gt; b[i])
        somme += a[i] - b[i];
      else
        somme += b[i] - a[i];
    }
    return(exp( - somme));'
  f &lt;- cxxfunction(sig, body, plugin="Rcpp", includes = c('#include &lt;math.h&gt;'))
  </code></pre>
  
  <p>I have used the following code. But it yields me an error I do not understand:</p>
  
  <pre><code>file11346d634c82.cpp: In function 'SEXPREC* file11346d634c82(SEXP, SEXP, SEXP)':
  file11346d634c82.cpp:32:16: error: ISO C++ forbids comparison between pointer and integer [-fpermissive]
  file11346d634c82.cpp:33:12: error: invalid use of incomplete type 'struct SEXPREC'
  C:/Users/sn235843/DOCUME~1/R/R-31~1.0/include/Rinternals.h:424:16: error: forward declaration of 'struct SEXPREC'
  file11346d634c82.cpp:33:19: error: invalid use of incomplete type 'struct SEXPREC'
  </code></pre>
  
  <p>The line 33 is the <code>or (i=0;i &lt; N ;i++){</code>. I have read the <code>cxxfunction</code> help and tried to change this line 33 to </p>
  
  <pre><code>for (i=0;i &lt; as&lt;int&gt;(N) ;i++){
  </code></pre>
  
  <p>and even:</p>
  
  <pre><code>for (i=0;i &lt; INTEGER(N) ;i++){
  </code></pre>
  
  <p>However, I still get errors...</p>
  
  <p>Where does this error come from? What does it mean?</p>
  
  <p><strong>Remark:</strong> this question is related to this <a href="https://stackoverflow.com/questions/24781428/how-could-i-speed-up-this-rcpp-code">one</a></p>