Opencv 3.4.3 compilation error

I am using OpenCV 3.4.3 which I compiled from sources using Visual Studio 2017. When I link to the compiled static lib to an application I get this error:

Error LNK2019 unresolved external symbol __cudaRegisterLinkedBinary_54_tmpxft_0000773c_00000000_17_gpu_mat_compute_70_cpp1_ii_71482d89 referenced in function “void __cdecl __sti____cudaRegisterAll(void)” (?__sti____cudaRegisterAll@@YAXXZ)
I am not able to figure out where it is coming from.
I looked online for similar errors and someone suggested to not use OpenCL, that did not work.

Build your static lib with relocatable device code, and build your application with relocatable device code.

An example of the project setup to do this is here:

https://stackoverflow.com/a/54259206/1695960

I am getting this error when compiling Opencv SDK samples. These samples have project files that are not CUDA projects in Visual Studio. Is there a way to handle this error in a regular windows VS project?

For what its worth, check out this OpenCV + CUDA Module video walkthrough and tutorial. Hope this helps!

https://cudaeducation.com/opencvcuda/

-Cuda Education
cudaeducation.com