我正在使用 Visual Studio 2008 运行 Windows 7 64 位。我安装了 CUDA 驱动程序和 SDK。SDK 附带了很多示例,包括已编译的可执行文件和源代码。编译后的可执行文件运行良好。当我打开 vc90 解决方案并在 Win32 配置中构建时,我收到此错误:
Error 1 fatal error LNK1181: cannot open input file '.\Release\bandwidthTest.cu.obj' bandwidthTest bandwidthTest
构建日志:
1>------ Build started: Project: bandwidthTest, Configuration: Release Win32 ------
1>Compiling with CUDA Build Rule...
1>"C:\CUDA\bin64\nvcc.exe" -arch sm_10 -ccbin "c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin" -Xcompiler "/EHsc /W3 /nologo /O2 /Zi /MT " -I"C:\CUDA\include" -I"../../common/inc" -maxrregcount=32 --compile -o "Release\bandwidthTest.cu.obj" "c:\ProgramData\NVIDIA Corporation\NVIDIA GPU Computing SDK\C\src\bandwidthTest\bandwidthTest.cu"
1>nvcc fatal : Visual Studio configuration file '(null)' could not be found for installation at 'c:/Program Files (x86)/Microsoft Visual Studio 9.0/VC/bin/../..'
1>Linking...
1>LINK : fatal error LNK1181: cannot open input file '.\Release\bandwidthTest.cu.obj'
1>Build log was saved at "file://c:\ProgramData\NVIDIA Corporation\NVIDIA GPU Computing SDK\C\src\bandwidthTest\Release\BuildLog.htm"
1>bandwidthTest - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
如果我尝试在 x64 中编译,它根本不会构建,只是跳过项目
1>------ Skipped Build: Project: bandwidthTest ------
1>
========== Build: 0 succeeded or up-to-date, 0 failed, 1 skipped ==========
我是 C++ 新手,从事 C# 已经有一段时间了。我确定我缺少一些小东西,但是您可以提供的任何线索将不胜感激。