# Using CUDA .DLL in VS 2010

**URL:** <https://forums.developer.nvidia.com/t/using-cuda-dll-in-vs-2010/26378>\
**Category:** CUDA Programming and Performance\
**Created:** [April 16, 2012, 8:57pm UTC](https://forums.developer.nvidia.com/t/using-cuda-dll-in-vs-2010/26378 "2012-04-16T20:57:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ADayAtTheRaces](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@ADayAtTheRaces](https://forums.developer.nvidia.com/u/ADayAtTheRaces)\
**Post date:** [April 16, 2012, 8:57pm UTC](https://forums.developer.nvidia.com/t/using-cuda-dll-in-vs-2010/26378/1 "2012-04-16T20:57:46Z")

</div>

Hi everybody!

I have created a CUDA .dll file in Visual Studio 2010. I have the .lib file also.  
Now I’m trying to call a function contained the .dll file from another code (the application code).

My application code is the following, it is very simple:

#include “stdafx.h”  
#include \<cuda\_runtime\_api.h\>

\_\_declspec(dllimport) void ForwardPropagation();

int \_tmain(int argc, \_TCHAR\* argv)  
{

```
printf("Calling main... \n");
ForwardPropagation();
printf("\nDONE! \n");

return 0;

```

}

When I try to compile it, it appears the following error in the output section in VS 2010:

1\>cuda\_vector\_app.obj : error LNK2019: unresolved external symbol “\_\_declspec(dllimport) void \_\_cdecl ForwardPropagation(void)” (\__imp_?ForwardPropagation@@YAXXZ) referenced in function wmain  
1\>C:\Users\Student3\Documents\cuda\_vector\_app\_3\x64\Debug\cuda\_vector\_app.exe : fatal error LNK1120: 1 unresolved externals

I’m not sure why this error is appearing because I have implemented another code under the same premises and I don’t have problems with it. I don’t know why for this specific case the compilation presents this error.

All comments and suggestions will be appreciated.

Arturo V.
