Linker Errors...

Hi All!

I’m very much a newbie to CUDA , i’ve just got my environment setup with MSVC++ 2010 express and CUDA 5.0 development kit.

I can compile all the sample code no problem in debug mode - Woo! good news!
But when I try to compile the program as as a release I get the following errors:

1> tmpxft_00001ed4_00000000-12_CUDA_Test1.ii
1>CUDA_Test1.cu.obj : error LNK2001: unresolved external symbol ___cudaUnregisterFatBinary@4
1>CUDA_Test1.cu.obj : error LNK2001: unresolved external symbol _cudaLaunch@4
1>CUDA_Test1.cu.obj : error LNK2001: unresolved external symbol _cudaSetupArgument@12
1>CUDA_Test1.cu.obj : error LNK2001: unresolved external symbol ___cudaRegisterFunction@40
1>CUDA_Test1.cu.obj : error LNK2001: unresolved external symbol ___cudaRegisterFatBinary@4
1>CUDA_Test1.cu.obj : error LNK2001: unresolved external symbol _cudaFree@4
1>CUDA_Test1.cu.obj : error LNK2001: unresolved external symbol _cudaMemcpy@16
1>CUDA_Test1.cu.obj : error LNK2001: unresolved external symbol _cudaConfigureCall@32
1>CUDA_Test1.cu.obj : error LNK2001: unresolved external symbol _cudaMalloc@8
1>C:\Dev-Cpp\TEST_cuda\Release\TEST_cuda.exe : fatal error LNK1120: 9 unresolved externals

As a newbie I’m probably making a fundamental error, I would be very pleased if someone could point out what i’m doing wrong!

Thanks!

Project property pages > Linker > Input > Additional Dependencies: cudart.lib

@Allanmac,

thanks for the suggestion - but I’ve triple checked and I added cudart.lib already…

Any other thoughts?

I would double-check that the library directory path is something like: “Linker>General>Additional Library Directories: $(CUDA_PATH)/lib/$(Platform);”.

If you already have it building in Debug then you should be able to find the issue by inspecting each Release C/CUDA/Linker property page for issues.

Seems i have a lot to learn - It was the cudart.lib in the additional dependencies after all! I haden’t realised they were configered seperatly for debug and release… it was only when i switched to release and saw all my settings changed that i realised.

Thanks allanmac!