# Cpp integration problem problem with extern C declaration

**URL:** <https://forums.developer.nvidia.com/t/cpp-integration-problem-problem-with-extern-c-declaration/3440>\
**Category:** CUDA Programming and Performance\
**Created:** [April 22, 2008, 11:14am UTC](https://forums.developer.nvidia.com/t/cpp-integration-problem-problem-with-extern-c-declaration/3440 "2008-04-22T11:14:26Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Peronet](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@Peronet](https://forums.developer.nvidia.com/u/Peronet)\
**Post date:** [April 22, 2008, 11:14am UTC](https://forums.developer.nvidia.com/t/cpp-integration-problem-problem-with-extern-c-declaration/3440/1 "2008-04-22T11:14:26Z")

</div>

I am having problem with my cpp / CUDA integration. I am looking at the cppIntegration example to get some clues, but a problem has occured.

In Main declaration i have:

```auto
#include "cutil.h"

extern "C" void

runTest(const int argc, const char** argv, char* data, int2* data_int2, unsigned int len);

```

and in main{} i do the following call:

```auto
runTest(argc, (const char**)argv, data, data_int2, len);

```

with correct input.

I have a cuda\_setup.cu containing:

```auto
#include <cutil.h>

#include <cuda_kernel.cu>

//function

extern "C" void

runTest(const int argc, const char** argv, char* data, int2* data_int2, unsigned int len)

{

//Memory allocation and kernel execution

}

```

the kernel itself is in cuda\_kernel.cu.

The error I am facing when trying to do the function call is:

> [@](#):
>
> 1\>Main.obj : error LNK2019: unresolved external symbol \_runTest referenced in function \_main
> 
> 1\>Debug/PPTE.exe : fatal error LNK1120: 1 unresolved externals

I am running VS2005 under Vista32. Any ideas?

---

<div class="post-metadata">

**Author:** ![Peronet](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@Peronet](https://forums.developer.nvidia.com/u/Peronet)\
**Post date:** [April 22, 2008, 11:40am UTC](https://forums.developer.nvidia.com/t/cpp-integration-problem-problem-with-extern-c-declaration/3440/2 "2008-04-22T11:40:23Z")

</div>

The problem was solved.

Problem was the cuda\_setup.cu had the incorrect paths under the General tab in Configuration Properteis → Custom Build Step.

I took the paths and entries from the cppIntegration example and it worked.

Thanks for the example!
