title: cuda with mingw - updated
body: <p>We have been developing our code in linux, but would like to compile a windows executable. The old non-gpu version compiles just fine with mingw in windows, so I was hoping I'd be able to do the same with the CUDA version.</p>
  
  <p>The strategy is to compile kernel code with nvcc in visual studio, and the rest with gcc in mingw.</p>
  
  <p>So far, we easily compiled the .cu file (with the kernel and kernel launches) in visual studio. However, we still can't compile the c code in mingw. The c code contains cuda api calls such as <code>cudaMalloc</code> and cuda types such as <code>cudaEvent_t</code>, so we must include cuda.h and cuda_runtime.h. However, gcc gives warnings and errors for these headers, for example:</p>
  
  <pre><code>../include/host_defines.h:57:0: warning: "__cdecl" redefined
  </code></pre>
  
  <p>and</p>
  
  <pre><code>../include/vector_functions.h:127:14: error: 'short_4' has no member named 'x'
  </code></pre>
  
  <p>Any ideas on how we can include these headers and compile the c portion of the code?</p>