Sid
Sid

Reputation: 231

CUDA - OpenCV - C++ Linking Error in Visual Studio 2010

I am using Visual Studio 2010 environment and am trying to accelerate some of my previously written OpenCV algorithms with the help of CUDA. I have a separate .cu file that compiles fine individually in Visual Studio and my .cpp file also compiles fine individually.

But when I try to build the solution that contains both of these files I get an error as below:

error LNK2019: unresolved external symbol "void __cdecl ComputeBasisKernelWrapper(float *,float *,float *,float *,float *,float *,float *,float *,float *,int,int)"

ComputeBasisKernelWrapper is a function that is defined using extern "C" in the .cu file and is responsible for making the necessary CUDA allocations and carrying out parallel computations.

I have a similar framework that works fine where I use a non object-oriented .c file that makes calls to functions in a .cu file.

So, I am not sure whether I need to make some changes in the compilation settings or if something else is the issue.

Any help is appreciated.

Upvotes: 0

Views: 312

Answers (1)

Sid
Sid

Reputation: 231

Fixed this problem by removing "extern".

Upvotes: 1

Related Questions