title: How to pass a struct from C++ to C?
body: <p>Updated:
  main.h</p>
  
  <pre><code>typedef struct
  {
      float x;
      float y;
      float z;
  }vec3;
  const int sizeOfGrid = 20000;
  vec3 *grid[sizeOfGrid];//assume initialized
  </code></pre>
  
  <p>main.cpp</p>
  
  <pre><code>#include "main.h"
  extern "C" void cudaTranslate(vec3 *x);
  void display()
  {
      cudaTranslate(grid);
  }
  </code></pre>
  
  <p>lineCuda.cu</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;assert.h&gt;
  #include &lt;cuda.h&gt;
  #include "main.h"
  
  extern "C" void cudaTranslate(vec3 *x)
  {
  
  }
  </code></pre>
  
  <p>getting:<br/> 
  main.obj : error LNK2005: "struct vec3 * * grid" (?grid@@3PAPAUvec3@@A) already defined in lineCuda.obj
  <br/>fatal error LNK1169: one or more multiply defined symbols found</p>