Is it so bad to set up a new Project?

Hi everyone,

I just had a horiable experience while try to set up a new project without using the SDK’s directory. Even when I add the directory to project’s -I option, I still keep getting errors like:

HelloWorld error: could not open source file “cutil.h”

Could anyone offer some help about this? What VC configuration do I need to set up if I want to start up a CUDA project from nothing?

BTW: I am using Visual Studio 2003.


– leoon.

Find out which folder the file “cutil.h” is and add it to your include path in Visual Studio. Or, a cleaner solution, add that folder to the CUDA_INCLUDE (or something like this) system variable (created when you install the toolkit) and add that variable to Visual Studio’s inlude paths. You’ll have to do the same for the libraries.

Also, if you are building a project completely from scratch, you’ll have to make sure that nvcc gets called to generate .c files for Visual Studio’s C++ compiler. There are a couple of ways doing that. One way is to follow what CUDA samples do (which is actually a bit more flelixble as you can choose different nvcc options for different files within a project). Another way is to create a custom compile rule to be applied to .cu files (easy to do in VS 2005, not sure how to do it in previous versions).


Great~~ It works.

For some reason, when I add the path to the project configuration, it didn’t work. When I add that to Visual Studio global configuration, everything works fine.

Thanks a lot.