Cuda device static library issue


I have built a cuda device static library using Visual Studio. However, when I tried to link my application to the library, it is giving “undefined reference to ” error.
According to the following link (, there is issue creating a cuda device static library using Visual Studio.
Has this issue been resolved on Visual Studio?


hi mhnrj79,
Sorry for inconsonance you met. it is bug of our cuda toolkit. we have tracked it internally.
thank you for your reporting for this.

hi mhnrj79,
this bug has been fixed in our next release.
there is work around for CUDA 6.0 and CUDA 6.5.

  1. disable -dlink for staticlib and 2) add staticlib.lib as a dependency for the host linker in your Application.

Note that there is a bug CUDA 6.0.targets that prevents #1 from working. To fix, go to line 730 in the ComputeCudaLinkOutput target and change it from this:

To this: