In short, when I try to compile a VS2008
project inside the IDE, it fails, but when I use the same command line on command prompt, it compiles. Can anybody help?
Details
Using VS2008
with Cuda
toolkit 3.2. Also have VS2010
installed.
Did the following: steps before starting the procedure.
- Added a custom rule file, which was in:
C:\Program Files (x86)\NVIDIA GPU Computing Toolkit\CUDA\v3.2\extras\visual_studio_integration\rules
- Then added
C:\Program Files (x86)\NVIDIA GPU Computing Toolkit\CUDA\v3.2\lib\x64
to additional library directories inlinker->general
in project's properties andcudart.lib
andcuda.lib
to additional dependencies.
Please let me know if I'm missing something.
The output of set command on cmd prompt is:
CUDA_BIN_PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v3.2\\bin
CUDA_INC_PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v3.2\\include
CUDA_LIB_PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v3.2\\lib\x64
CUDA_PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v3.2\
CUDA_PATH_V3_2=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v3.2\
Oops, forgot the error messages.
1>t.cu.obj : error LNK2019: unresolved external symbol ___cudaUnregisterFatBinary@4 referenced in function "void __cdecl __cudaUnregisterBinaryUtil(void)" (?__cudaUnregisterBinaryUtil@@YAXXZ)
1>t.cu.obj : error LNK2019: unresolved external symbol _cudaLaunch@4 referenced in function "enum cudaError __cdecl cudaLaunch<char>(char *)" (??$cudaLaunch@D@@YA?AW4cudaError@@PAD@Z)
1>t.cu.obj : error LNK2019: unresolved external symbol _cudaSetupArgument@12 referenced in function "void __cdecl __device_stub__Z12compute_sum4P6float4S0_S0_i(struct float4 *,struct float4 *,struct float4 *,int)" (?__device_stub__Z12compute_sum4P6float4S0_S0_i@@YAXPAUfloat4@@00H@Z)
1>t.cu.obj : error LNK2019: unresolved external symbol ___cudaRegisterFunction@40 referenced in function "void __cdecl __sti____cudaRegisterAll_47_tmpxft_00000ea8_00000000_8_t_compute_10_cpp1_ii_65ce9b46(void)" (?__sti____cudaRegisterAll_47_tmpxft_00000ea8_00000000_8_t_compute_10_cpp1_ii_65ce9b46@@YAXXZ)
1>t.cu.obj : error LNK2019: unresolved external symbol ___cudaRegisterFatBinary@4 referenced in function "void __cdecl __sti____cudaRegisterAll_47_tmpxft_00000ea8_00000000_8_t_compute_10_cpp1_ii_65ce9b46(void)" (?__sti____cudaRegisterAll_47_tmpxft_00000ea8_00000000_8_t_compute_10_cpp1_ii_65ce9b46@@YAXXZ)
1>t.cu.obj : error LNK2019: unresolved external symbol _cudaEventDestroy@4 referenced in function _main
1>t.cu.obj : error LNK2019: unresolved external symbol _cudaEventElapsedTime@12 referenced in function _main
1>t.cu.obj : error LNK2019: unresolved external symbol _cudaEventSynchronize@4 referenced in function _main
1>t.cu.obj : error LNK2019: unresolved external symbol _cudaConfigureCall@32 referenced in function _main
1>t.cu.obj : error LNK2019: unresolved external symbol _cudaEventRecord@8 referenced in function _main
1>t.cu.obj : error LNK2019: unresolved external symbol _cudaThreadSynchronize@0 referenced in function _main
1>t.cu.obj : error LNK2019: unresolved external symbol _cudaEventCreate@4 referenced in function _main
1>t.cu.obj : error LNK2019: unresolved external symbol _cudaMemcpy@16 referenced in function _main
1>t.cu.obj : error LNK2019: unresolved external symbol _cudaMalloc@8 referenced in function _main
1>D:\projects\cup1\Debug\cup1.exe : fatal error LNK1120: 14 unresolved externals
This is the command line:
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v3.2\\bin\nvcc.exe" -gencode=arch=compute_10,code=\"sm_10,compute_10\" -gencode=arch=compute_20,code=\"sm_20,compute_20\" --machine 32 -ccbin "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin" -Xcompiler "/EHsc /W3 /nologo /O2 /Zi /MT " -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v3.2\\include" -maxrregcount=32 --compile -o "Debug/t.cu.obj" t.cu