views:

554

answers:

1

I't trying to work with CUDA with Visual Studio 2008 Professional. I'm using Windows 7 64 bit and I've done following steps:
- Downloaded and installed CUDA Driver, Toolkit ans SDK. I can run any example from SDK.
- Downloaded and installed CUDA VS Wizard
When I'm trying to create a CUDA Win App I've got the following compile error:
Error 1 fatal error LNK1181: cannot open input file '.\x64\Debug\main.obj' Any ideas how to fix it?

+1  A: 

I’m not familiar with the Visual Studio wizard that you have used (it is not an NVIDIA product so not sure how well supported it is).

In general I would recommend creating a project using the Microsoft default wizards (e.g. Console app) and then adding the CUDA build rule (cuda.rules). The build rule instructs Visual Studio how to compile .cu files to .obj files that can then be linked with your application as normal, then all you need to do is add .cu files and they will be integrated automatically.

The cuda build rules also provide access to the latest compiler flags etc. via the project properties, and when you upgrade the compiler it is simple to update the cuda.rules file from the latest SDK if you need any new features.

The cuda.rules file (in the common directory) and the usertype.dat file for syntax highlighting (in the doc/syntax_highlighting directory) are available in the SDK.

Incidentally I'd also recommend adding Intellisense support for .cu files. The registry key for VS2008 (replace 9.0 with 8.0 for VS2005) is:

[HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\9.0\Languages\Language Services\C/C++]
"NCB Default C/C++ Extensions"=".cpp;.cxx;.c;.cc;.h;.hh;.hxx;.hpp;.inl;.tlh;.tli;.cu;.cuh;.cl"
Tom
I don't think it is his wizard that's the problem. I am running the same setup (win7 x64) and when I open one of the sample projects I get a similar error
Mr Bell