tags:

views:

713

answers:

3

I'm getting this error while trying to run sample codes in CUDA SDK. I have CUDA 2.3 and Visual studio 2008

LINK : fatal error LNK1181: cannot open input file 'cutil32D.lib'

Any pointers how to solve this?

+1  A: 

Your MSVC project needs to include the library cutil32D.lib to link. Once you specify it as a library the linker needs to include in the final binary artifact this problem will go away. It would seem the library is missing at the location the linker is going to look for it. You'll have to change the library search paths or move that file to a directory in which the linker is already looking.

fbrereto
how to do that in Visual studio 2008 ?
emkrish
emkrish,Open your Visual Studio project's Properties, Click on Linker, Add the path to the "Additional Library Directories"Read the Visual Studio Help docs: http://msdn.microsoft.com/en-us/library/1xhzskbe.aspx
Die in Sente
A: 

Since you're compiling the SDK samples, the project files are probably correct. Far more likely is that you haven't built the cutil library. Go to the SDK install directory, then into the "C" directory. You'll see a "common" directory, in there open the cutil.sln solution (or cutil_vc90.sln for VS2008) and build it in release and debug modes for your platform.

Then try your sample again.

The cutil library is used to avoid replicating the same code through all the samples, if you're starting your own project I'd avoid reusing the cutil library and write your own checker. For example, you should probably fail gracefully if you detect a CUDA error rather than just calling exit() as done in cutil.

The cuda.rules file included in the SDK is highly recommended! Using this you can just add .cu files to any project and Visual Studio will know how to compile them and link them in to the final executable. Easy!

Tom
A: 

I work with SDK 3.1 on Windows 7 64-bit and have the same issue as in original post. In "C:\ProgramData\NVIDIA Corporation\NVIDIA GPU Computing SDK\C\common\lib" I have "cUtil64.lib", and no "cUtil32.lib". I suspect the problem is that "cUtil32.lib" is not installed under Windows 7 64-bit. Should I build "cUtil32.lib" manually or I can change a reference (somewhere) to "cUtil64.lib"?

Andrey