title: Cannot get simple renderscript maths function to run
body: <p>I am trying to get a simple renderscript function to take two numnbers, add them and return the result, however I have not managed to find an example project to do that smoothly.
  I keep getting a weird error when I try to load the file:</p>
  
  <pre><code>ScriptC_myexamplescript myScript;
  RenderScript rs = RenderScript.create(this);
  </code></pre>
  
  <p>I get the error:</p>
  
  <pre><code>Symbol not found: .rs.dtor  on the next line:
  myScript = new ScriptC_myexamplescript(rs, getResources(), R.raw.myexamplescript);
  </code></pre>
  
  <p>My .rs file is just something simple:</p>
  
  <pre><code>#pragma version(1)
  #pragma rs java_package_name(com.exercise.&lt;my pacakge name&gt;);
  
  void init(){
  
  }
  
  void root(const float *v_in, float *v_out) {
  
     const float *data = v_in;
     float *outData = v_out;
     *outData = *data;    
  
  }
  </code></pre>
  
  <p>Does anyone know what this means, or if there is a simple project I can download for Android ICS and later that does maths, not actual rendering that just works?</p>
  
  <p>(I can get a rendering script file to work, but that isn't what I want. I don't want any graphics in it)</p>
  
  <p>EDIT 
  Today I have tried to make it run, and get the following problem:</p>
  
  <pre><code>Allocation mInAllocation = null;
  Allocation mOutAllocation;
  
  float[] A = new float[1];
  for (int i = 0; i &lt; 1; i++) {
  A[i] = 2;
  }
  
  
  
  Allocation inFloatPointer = Allocation.createSized(rs, Element.F32(rs), A.length, Allocation.USAGE_SCRIPT);
  Allocation outFloatPointer = Allocation.createSized(rs, Element.F32(rs), A.length, Allocation.USAGE_SCRIPT);  
  inFloatPointer.copyFrom(A); // copies from an array of floats (random numbers in this test case).
  mScript.forEach_root(inFloatPointer, outFloatPointer);            
  </code></pre>
  
  <p>I get the error message:
  the method forEach_root is undedifed for type ScriptC_RenderScript
  There is no function forEach_root in the .java file and even after I clean the project it still is not there.</p>
  
  <p>Is there a simple project I can download with just a maths function I can download?</p>