title: Error in a simple cuda compilation
body: <p>FSPB_main.cpp</p>
  
  <pre><code>int main(int args, char* argv[]){    
      .......   
  
     float *d_a;   
     cudaMalloc( (void**)&amp;d_a, 5*sizeof(float) );
  
  }
  </code></pre>
  
  <blockquote>
    <p>$ nvcc -L/usr/local/cuda/lib -lcutil -lcudpp -lcuda -lcudart -c -o
    FSPB_main.o FSPB_main.cpp</p>
    
    <p>FSPB_main.cpp: In function ‘int main(int, char**)’:
    FSPB_main.cpp:167:45: error: ‘cudaMalloc’ was not declared in this
    scope</p>
  </blockquote>
  
  <p>What does this error mean? It's just a cudaMalloc and it suppose to be supported for the compiler right?</p>
  
  <p>Can functions like cudaMalloc be used in a .cpp file? Do I need to create a .cu file just for anything what comes from CUDA?</p>