title: doParallel issue with inline function on Windows 7 (works on Linux)
body: <p>I am using R 3.0.1 both on Windows 7 and Linux (SUSE Server 11 (x86_64)). The following example code produces an error on Windows but not on Linux. All the toolboxes listed are up-to-date in both machines. 
  The Windows error is:</p>
  
  <pre><code>Error in { : task 1 failed - "NULL value passed as symbol address"
  </code></pre>
  
  <p>If I change <code>%dopar% to %do%</code>, the Windows code runs without any errors. My initial guess was that this relates to some configuration issue in Windows and I tried reinstalling Rcpp and R but that did not help. The error seems to be related to scoping - if I define and compile the function cFunc inside f1, then <code>%dopar%</code> works but, as expected, it is very slow since we are calling the compiler once for each task.</p>
  
  <p>Does anyone have some insights on why the error happens or suggestions on how to fix it?</p>
  
  <pre><code>library(inline)
  sigFunc &lt;- signature(x="numeric", size_x="numeric")
  code &lt;- ' double tot =0;
  for(int k = 0; k &lt; INTEGER(size_x)[0]; k++){
  tot += REAL(x)[k];
  };
  return ScalarReal(tot);
  ' 
  cFunc &lt;- cxxfunction(sigFunc, code)
  
  f1 &lt;- function(){
  x &lt;- rnorm(100)
  a &lt;- cFunc(x=x, size_x=as.integer(length(x)))
  return(a)
  }
  
  library(foreach)
  library(doParallel)
  registerDoParallel()
  # this produces an error in Windows but not in Linux
  res &lt;- foreach(counter=(1:100)) %dopar% {f1()}
  # this works for both Windows and Linux
  res &lt;- foreach(counter=(1:100)) %do% {f1()}
  
  # The following is not a practical solution, but I can compile cFunc inside f1 and then     this works in Windows but it is very slow
  f1 &lt;- function(){
  library(inline)
  sigFunc &lt;- signature(x="numeric", size_x="numeric")
  
  code &lt;- ' double tot =0;
  for(int k = 0; k &lt; INTEGER(size_x)[0]; k++){
  tot += REAL(x)[k];
  };
  return ScalarReal(tot);
  ' 
  cFunc &lt;- cxxfunction(sigFunc, code)
  x &lt;- rnorm(100)
  a &lt;- cFunc(x=x, size_x=as.integer(length(x)))
  return(a)
  }
  # this now works in Windows but is very slow
  res &lt;- foreach(counter=(1:100)) %dopar% {f1()}
  </code></pre>
  
  <p>Thanks!
  Gustavo</p>