How to setup Cuda on vs 2010

Hello All,

I am new to the Cuda tool kit and trying to get it to run on VS 2010. I am running windows xp with toolkit 3.1. I managed to get most of the path dependencies setup(So I think, I am not very familiar with this task as I am just a basic programmer) and I can compile a basic program but if I try to use any of the cuda syntax it won’t compile. Any help would be great. Here is my code so far:

#include <cuda.h>

#include <iostream>

__global__ void kernel(void){

}

int main(void)

{

	printf("Hello World!\n");

	std::cin.get();

	return 0;

}

I get the following errors when I compile:

1>c:\documents and settings\thompssb\my documents\visual studio 2008\projects\howtotestcuda\howtotestcuda\testmain.cpp(5) : error C2144: syntax error : 'void' should be preceded by ';'

1>c:\documents and settings\thompssb\my documents\visual studio 2008\projects\howtotestcuda\howtotestcuda\testmain.cpp(5) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

If I comment out the global void kernel function it compiles fine. Any help is greatly appreciated.

I am also new to CUDA programming and took a shot at setting up the most recent CUDA SDK with VS2010 Professional. I’ll admit I did not give it my total effort, and gave up after a short while. Since I had VS2008 Professional available, I installed that and all was well after I also installed the most recent DirectX SDK. With one other minor tweak, I wish I could remember, all 81 example programs built with no errors. Now I can start learning from example.

Bye. B)

For path dependencies I went under the custom build rules (right click the project) . Then choose the find existing ( I then navigate to the sdk folder and in the common you will find a cuda.target file. choose that).

Then under the project-> Program Name properties → choose linker → General Then under additional libraries add the path to your cuda\lib

Then under the project-> Program Name properties → choose linker → input additional dependencies add cudart.lib

This made it at least compile but I can’t use any of the cuda tools External Media I know I am missing something just not sure what.