opencvsharp: Errors while building OpenCVSharp from source

Summary of your issue

Hi, I’m trying to build opencvsharp form source but after building as written on the docs a little bit of problems with the linkage I’m stuck with this errors.

>warpers_cuda.obj : error LNK2001: unresolved external symbol "void __cdecl cv::cuda::remap(class cv::_InputArray const &,class cv::_OutputArray const &,class cv::_InputArray const &,class cv::_InputArray const &,int,int,class cv::Scalar_<double>,class cv::cuda::Stream &)" (?remap@cuda@cv@@YAXAEBV_InputArray@2@AEBV_OutputArray@2@00HHV?$Scalar_@N@2@AEAVStream@12@@Z)
1>btv_l1_cuda.obj : error LNK2001: unresolved external symbol "void __cdecl cv::cuda::remap(class cv::_InputArray const &,class cv::_OutputArray const &,class cv::_InputArray const &,class cv::_InputArray const &,int,int,class cv::Scalar_<double>,class cv::cuda::Stream &)" (?remap@cuda@cv@@YAXAEBV_InputArray@2@AEBV_OutputArray@2@00HHV?$Scalar_@N@2@AEAVStream@12@@Z)
1>btv_l1_cuda.obj : error LNK2001: unresolved external symbol "void __cdecl cv::cuda::add(class cv::_InputArray const &,class cv::_InputArray const &,class cv::_OutputArray const &,class cv::_InputArray const &,int,class cv::cuda::Stream &)" (?add@cuda@cv@@YAXAEBV_InputArray@2@0AEBV_OutputArray@2@0HAEAVStream@12@@Z)
1>blenders.obj : error LNK2001: unresolved external symbol "void __cdecl cv::cuda::add(class cv::_InputArray const &,class cv::_InputArray const &,class cv::_OutputArray const &,class cv::_InputArray const &,int,class cv::cuda::Stream &)" (?add@cuda@cv@@YAXAEBV_InputArray@2@0AEBV_OutputArray@2@0HAEAVStream@12@@Z)
1>btv_l1_cuda.obj : error LNK2001: unresolved external symbol "void __cdecl cv::cuda::multiply(class cv::_InputArray const &,class cv::_InputArray const &,class cv::_OutputArray const &,double,int,class cv::cuda::Stream &)" (?multiply@cuda@cv@@YAXAEBV_InputArray@2@0AEBV_OutputArray@2@NHAEAVStream@12@@Z)
1>btv_l1_cuda.obj : error LNK2001: unresolved external symbol "void __cdecl cv::cuda::addWeighted(class cv::_InputArray const &,double,class cv::_InputArray const &,double,double,class cv::_OutputArray const &,int,class cv::cuda::Stream &)" (?addWeighted@cuda@cv@@YAXAEBV_InputArray@2@N0NNAEBV_OutputArray@2@HAEAVStream@12@@Z)
1>btv_l1_cuda.obj : error LNK2001: unresolved external symbol "void __cdecl cv::cuda::resize(class cv::_InputArray const &,class cv::_OutputArray const &,class cv::Size_<int>,double,double,int,class cv::cuda::Stream &)" (?resize@cuda@cv@@YAXAEBV_InputArray@2@AEBV_OutputArray@2@V?$Size_@H@2@NNHAEAVStream@12@@Z)
1>btv_l1_cuda.obj : error LNK2001: unresolved external symbol "struct cv::Ptr<class cv::cuda::Filter> __cdecl cv::cuda::createGaussianFilter(int,int,class cv::Size_<int>,double,double,int,int)" (?createGaussianFilter@cuda@cv@@YA?AU?$Ptr@VFilter@cuda@cv@@@2@HHV?$Size_@H@2@NNHH@Z)
1>seam_finders.obj : error LNK2001: unresolved external symbol "void __cdecl cv::cuda::graphcut(class cv::cuda::GpuMat &,class cv::cuda::GpuMat &,class cv::cuda::GpuMat &,class cv::cuda::GpuMat &,class cv::cuda::GpuMat &,class cv::cuda::GpuMat &,class cv::cuda::GpuMat &,class cv::cuda::Stream &)" (?graphcut@cuda@cv@@YAXAEAVGpuMat@12@000000AEAVStream@12@@Z)
1>blenders.obj : error LNK2001: unresolved external symbol "void __cdecl cv::cuda::subtract(class cv::_InputArray const &,class cv::_InputArray const &,class cv::_OutputArray const &,class cv::_InputArray const &,int,class cv::cuda::Stream &)" (?subtract@cuda@cv@@YAXAEBV_InputArray@2@0AEBV_OutputArray@2@0HAEAVStream@12@@Z)
1>blenders.obj : error LNK2001: unresolved external symbol "void __cdecl cv::cuda::compare(class cv::_InputArray const &,class cv::_InputArray const &,class cv::_OutputArray const &,int,class cv::cuda::Stream &)" (?compare@cuda@cv@@YAXAEBV_InputArray@2@0AEBV_OutputArray@2@HAEAVStream@12@@Z)
1>blenders.obj : error LNK2001: unresolved external symbol "void __cdecl cv::cuda::copyMakeBorder(class cv::_InputArray const &,class cv::_OutputArray const &,int,int,int,int,int,class cv::Scalar_<double>,class cv::cuda::Stream &)" (?copyMakeBorder@cuda@cv@@YAXAEBV_InputArray@2@AEBV_OutputArray@2@HHHHHV?$Scalar_@N@2@AEAVStream@12@@Z)
1>blenders.obj : error LNK2001: unresolved external symbol "void __cdecl cv::cuda::pyrDown(class cv::_InputArray const &,class cv::_OutputArray const &,class cv::cuda::Stream &)" (?pyrDown@cuda@cv@@YAXAEBV_InputArray@2@AEBV_OutputArray@2@AEAVStream@12@@Z)
1>blenders.obj : error LNK2001: unresolved external symbol "void __cdecl cv::cuda::pyrUp(class cv::_InputArray const &,class cv::_OutputArray const &,class cv::cuda::Stream &)" (?pyrUp@cuda@cv@@YAXAEBV_InputArray@2@AEBV_OutputArray@2@AEAVStream@12@@Z)
1>matchers.obj : error LNK2001: unresolved external symbol "public: static struct cv::Ptr<class cv::cuda::DescriptorMatcher> __cdecl cv::cuda::DescriptorMatcher::createBFMatcher(int)" (?createBFMatcher@DescriptorMatcher@cuda@cv@@SA?AU?$Ptr@VDescriptorMatcher@cuda@cv@@@3@H@Z)
1>frame_source.obj : error LNK2001: unresolved external symbol "struct cv::Ptr<class cv::cudacodec::VideoReader> __cdecl cv::cudacodec::createVideoReader(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class std::vector<int,class std::allocator<int> > const &,struct cv::cudacodec::VideoReaderInitParams)" (?createVideoReader@cudacodec@cv@@YA?AU?$Ptr@VVideoReader@cudacodec@cv@@@2@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEBV?$vector@HV?$allocator@H@std@@@5@UVideoReaderInitParams@12@@Z)
1>optical_flow.obj : error LNK2001: unresolved external symbol "void __cdecl cv::cuda::merge(class cv::cuda::GpuMat const *,unsigned __int64,class cv::_OutputArray const &,class cv::cuda::Stream &)" (?merge@cuda@cv@@YAXPEBVGpuMat@12@_KAEBV_OutputArray@2@AEAVStream@12@@Z)
1>optical_flow.obj : error LNK2001: unresolved external symbol "void __cdecl cv::cuda::split(class cv::_InputArray const &,class cv::cuda::GpuMat *,class cv::cuda::Stream &)" (?split@cuda@cv@@YAXAEBV_InputArray@2@PEAVGpuMat@12@AEAVStream@12@@Z)
1>optical_flow.obj : error LNK2001: unresolved external symbol "public: static struct cv::Ptr<class cv::cuda::BroxOpticalFlow> __cdecl cv::cuda::BroxOpticalFlow::create(double,double,double,int,int,int)" (?create@BroxOpticalFlow@cuda@cv@@SA?AU?$Ptr@VBroxOpticalFlow@cuda@cv@@@3@NNNHHH@Z)
1>optical_flow.obj : error LNK2001: unresolved external symbol "public: static struct cv::Ptr<class cv::cuda::DensePyrLKOpticalFlow> __cdecl cv::cuda::DensePyrLKOpticalFlow::create(class cv::Size_<int>,int,int,bool)" (?create@DensePyrLKOpticalFlow@cuda@cv@@SA?AU?$Ptr@VDensePyrLKOpticalFlow@cuda@cv@@@3@V?$Size_@H@3@HH_N@Z)
1>optical_flow.obj : error LNK2001: unresolved external symbol "public: static struct cv::Ptr<class cv::cuda::FarnebackOpticalFlow> __cdecl cv::cuda::FarnebackOpticalFlow::create(int,double,bool,int,int,int,double,int)" (?create@FarnebackOpticalFlow@cuda@cv@@SA?AU?$Ptr@VFarnebackOpticalFlow@cuda@cv@@@3@HN_NHHHNH@Z)
1>optical_flow.obj : error LNK2001: unresolved external symbol "public: static struct cv::Ptr<class cv::cuda::OpticalFlowDual_TVL1> __cdecl cv::cuda::OpticalFlowDual_TVL1::create(double,double,double,int,int,double,int,double,double,bool)" (?create@OpticalFlowDual_TVL1@cuda@cv@@SA?AU?$Ptr@VOpticalFlowDual_TVL1@cuda@cv@@@3@NNNHHNHNN_N@Z)
1>input_array_utility.obj : error LNK2001: unresolved external symbol "void __cdecl cv::cuda::cvtColor(class cv::_InputArray const &,class cv::_OutputArray const &,int,int,class cv::cuda::Stream &)" (?cvtColor@cuda@cv@@YAXAEBV_InputArray@2@AEBV_OutputArray@2@HHAEAVStream@12@@Z)
1>C:\Users\Utente\Documents\opencvsharp\src\Release\x64\OpenCvSharpExtern.dll : fatal error LNK1120: 21 unresolved externals
1>Done building project "OpenCvSharpExtern.vcxproj" -- FAILED.

Environment

I’m on a windows machine with win11

What did you do when you faced the problem?

I have tried to give all the possible additional .lib files in the Linker -> Input -> Additional Dependecies but nothing of that worked. I have followed the solution proposed here https://github.com/shimat/opencvsharp/issues/967 but the case is different for me. Sorry to bother @AvenSun, if you have any suggestion I will be happy to try it.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 22 (11 by maintainers)

Most upvoted comments

glad to hear that. you’re welcome.

@toita86

image

the native OpenCvExtern.dll was built in 64bit, so make sure your console app was built in AnyCPU or 64 bit.

you can find this setting in property of console project.