我根据使用CUDA在SURF matcher的opencv github页面上给出的示例编写了我的代码。
当我尝试构建时,我收到以下错误:
1>Testing.obj : error LNK2019: 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) referenced in function main
1>Testing.obj : error LNK2019: unresolved external symbol "public: __cdecl cv::cuda::SURF_CUDA::SURF_CUDA(void)" (??0SURF_CUDA@cuda@cv@@QEAA@XZ) referenced in function main
1>Testing.obj : error LNK2019: unresolved external symbol "public: int __cdecl cv::cuda::SURF_CUDA::defaultNorm(void)const " (?defaultNorm@SURF_CUDA@cuda@cv@@QEBAHXZ) referenced in function main
1>Testing.obj : error LNK2019: unresolved external symbol "public: void __cdecl cv::cuda::SURF_CUDA::downloadKeypoints(class cv::cuda::GpuMat const &,class std::vector<class cv::KeyPoint,class std::allocator<class cv::KeyPoint> > &)" (?downloadKeypoints@SURF_CUDA@cuda@cv@@QEAAXAEBVGpuMat@23@AEAV?$vector@VKeyPoint@cv@@V?$allocator@VKeyPoint@cv@@@std@@@std@@@Z) referenced in function main
1>Testing.obj : error LNK2019: unresolved external symbol "public: void __cdecl cv::cuda::SURF_CUDA::downloadDescriptors(class cv::cuda::GpuMat const &,class std::vector<float,class std::allocator<float> > &)" (?downloadDescriptors@SURF_CUDA@cuda@cv@@QEAAXAEBVGpuMat@23@AEAV?$vector@MV?$allocator@M@std@@@std@@@Z) referenced in function main
1>Testing.obj : error LNK2019: unresolved external symbol "public: void __cdecl cv::cuda::SURF_CUDA::operator()(class cv::cuda::GpuMat const &,class cv::cuda::GpuMat const &,class cv::cuda::GpuMat &,class cv::cuda::GpuMat &,bool)" (??RSURF_CUDA@cuda@cv@@QEAAXAEBVGpuMat@12@0AEAV312@1_N@Z) referenced in function main
1><computer_dir>\TestCode\x64\Debug\TestCode.exe : fatal error LNK1120: 6 unresolved externals
所有库似乎都正确链接,我在编写代码时没有收到任何错误。
如果有人能说出错误的话会很棒。谢谢!