开发者

error in CUDA compilation

I'm getting this error while trying to run sample codes in CUDA SDK. I have CU开发者_如何学GoDA 2.3 and Visual studio 2008

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

Any pointers how to solve this?


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!


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.


I ran into the same issue. It turned out not only did I need to build the cutil project but also the shrUtils project under the SDK's shared folder.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜