# Linker Errors...

**URL:** <https://forums.developer.nvidia.com/t/linker-errors/28255>\
**Category:** CUDA Programming and Performance\
**Created:** [February 12, 2013, 5:50pm UTC](https://forums.developer.nvidia.com/t/linker-errors/28255 "2013-02-12T17:50:35Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![IanWeston](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@IanWeston](https://forums.developer.nvidia.com/u/IanWeston)\
**Post date:** [February 12, 2013, 5:50pm UTC](https://forums.developer.nvidia.com/t/linker-errors/28255/1 "2013-02-12T17:50:35Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![allanmac](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/allanmac/32/12124_2.png) [@allanmac](https://forums.developer.nvidia.com/u/allanmac)\
**Post date:** [February 12, 2013, 7:00pm UTC](https://forums.developer.nvidia.com/t/linker-errors/28255/2 "2013-02-12T19:00:26Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![IanWeston](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@IanWeston](https://forums.developer.nvidia.com/u/IanWeston)\
**Post date:** [February 12, 2013, 7:20pm UTC](https://forums.developer.nvidia.com/t/linker-errors/28255/3 "2013-02-12T19:20:32Z")

</div>

@Allanmac,

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

Any other thoughts?

---

<div class="post-metadata">

**Author:** ![allanmac](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/allanmac/32/12124_2.png) [@allanmac](https://forums.developer.nvidia.com/u/allanmac)\
**Post date:** [February 12, 2013, 7:49pm UTC](https://forums.developer.nvidia.com/t/linker-errors/28255/4 "2013-02-12T19:49:03Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![IanWeston](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@IanWeston](https://forums.developer.nvidia.com/u/IanWeston)\
**Post date:** [February 13, 2013, 3:29pm UTC](https://forums.developer.nvidia.com/t/linker-errors/28255/5 "2013-02-13T15:29:42Z")

</div>

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!
