I am doing some programming with nVidia's CUDA C. I am using Visual Studio 2008 as my development environment and I am having some troubles with some linking and I am wondering if someone knows a way to fix it or has had the same problem and could offer a solution.
My program is made up of 3 files. 1 header file (stuff.h), 1 C source file (stuff.c) and 1 CUDA C file (main.cu). (The names are fake but it's just to illustrate the point).
Now stuff.h/stuff.c define/implement some helper functions that I call from inside main.cu.
I am using visual studio 2008 and the Cuda.rules from nVidia's GPU Computing SDK and everything compiles fine but... when it comes to linking all of the files together it fails. It seems that all of the functions defined in stuff.h (and implemented in stuff.c) are not being linked in correctly as they are flagged as "unresolved external symbols".
What are the possible causes and how could I fix this?
Many thanks,
ExtremeCoder
Okay so I have managed to get it all compiling. It seems all I had to do was change the extension of the stuff implementation file from .c to .cpp (meaning compiling as c++ works whereas compiling as c does not!).
What could be causing this? I would rather keep everything as a .c instead of .cpp (as this is really meant to be C code...
Any pointers?