title: CUDA: __device__ and __global__ error: expected constructor, destructor, or type conversion before "unsigned"/"void""
body: <p>So my problem is: I'm using Nvidia's nsight application on mac os x mountain lion to write a CUDA application: The source code is a .h/.cu/.cpp mix.</p>
  
  <p>I have a HelloCUDA.h header with following declarations:</p>
  
  <pre><code>//yep, both taken from examples.
  __device__ unsigned int bitreverse2(unsigned int number);
  
  __global__ void bitreverse(void *data);
  </code></pre>
  
  <p>and i have a HelloCUDA.cu file that defines these methods:</p>
  
  <pre><code>__device__ unsigned int bitreverse3(unsigned int number) {
      //definition
      return number;
  }
  
  __global__ void bitreverse4(void *data) {
      //another definition...
      bitreverse3(idata[threadIdx.x]);
  }
  </code></pre>
  
  <p>It worked, until I added a new C++ class files (.h/.cpp) using eclipse's (nsight) new class wizard. Now, when I try to build that thing:</p>
  
  <pre><code>../src/HelloCUDA.h:21: error: expected constructor, destructor, or type conversion before ‚Äòunsigned‚Äô
  ../src/HelloCUDA.h:23: error: expected constructor, destructor, or type conversion before ‚Äòvoid‚Äô
  </code></pre>
  
  <p>I checked project settings, I don't think anything has changes.</p>
  
  <p>So, what gives? Anybody could, please, help me with that one?</p>