C ++:将子系统控制台更改为Windows后,为什么代码(使用openCV)不起作用?

时间:2018-08-13 14:34:00

标签: c++ windows opencv visual-studio-2012 linker

我已使用Visual Studio 2012中用C ++编写的opencv用代码创建了一个控制台应用程序。 项目已成功构建并运行。 因此,我决定创建一个表单并尝试使用此代码,它给出以下错误:

MLSWarpImage.obj : error LNK2028: unresolved token (0A0007F3) "public: __thiscall cv::UMat::~UMat(void)" (??1UMat@cv@@$$FQAE@XZ) referenced in function "public: __thiscall cv::HOGDescriptor::HOGDescriptor(struct cv::HOGDescriptor const &)" (??0HOGDescriptor@cv@@$$FQAE@ABU01@@Z)
1>MLSWarpImage.obj : error LNK2028: unresolved token (0A0007FA) "public: void __thiscall cv::UMat::copySize(class cv::UMat const &)" (?copySize@UMat@cv@@$$FQAEXABV12@@Z) referenced in function "public: __thiscall cv::UMat::UMat(class cv::UMat const &)" (??0UMat@cv@@$$FQAE@ABV01@@Z)
1>MLSWarpImage.obj : error LNK2028: unresolved token (0A00083F) "void __cdecl cv::fastFree(void *)" (?fastFree@cv@@$$FYAXPAX@Z) referenced in function "public: __thiscall cv::Mat::~Mat(void)" (??1Mat@cv@@$$FQAE@XZ)
1>MLSWarpImage.obj : error LNK2019: unresolved external symbol "void __cdecl cv::fastFree(void *)" (?fastFree@cv@@$$FYAXPAX@Z) referenced in function "public: __thiscall cv::Mat::~Mat(void)" (??1Mat@cv@@$$FQAE@XZ)
1>MLSWarpImage.obj : error LNK2019: unresolved external symbol "public: void __thiscall cv::UMat::copySize(class cv::UMat const &)" (?copySize@UMat@cv@@$$FQAEXABV12@@Z) referenced in function "public: __thiscall cv::UMat::UMat(class cv::UMat const &)" (??0UMat@cv@@$$FQAE@ABV01@@Z)
1>MLSWarpImage.obj : error LNK2019: unresolved external symbol "public: void __thiscall cv::Mat::copySize(class cv::Mat const &)" (?copySize@Mat@cv@@QAEXABV12@@Z) referenced in function "public: __thiscall cv::Mat::Mat(class cv::Mat const &)" (??0Mat@cv@@QAE@ABV01@@Z)
1>MLSWarpImage.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall cv::HOGDescriptor::setSVMDetector(class cv::_InputArray const &)" (?setSVMDetector@HOGDescriptor@cv@@UAEXABV_InputArray@2@@Z)
1>MLSWarpImage.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall cv::HOGDescriptor::read(class cv::FileNode &)" (?read@HOGDescriptor@cv@@UAE_NAAVFileNode@2@@Z)
1>MLSWarpImage.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall cv::HOGDescriptor::write(class cv::FileStorage &,class cv::String const &)const " (?write@HOGDescriptor@cv@@UBEXAAVFileStorage@2@ABVString@2@@Z)
1>MLSWarpImage.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall cv::HOGDescriptor::load(class cv::String const &,class cv::String const &)" (?load@HOGDescriptor@cv@@UAE_NABVString@2@0@Z)
1>MLSWarpImage.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall cv::HOGDescriptor::save(class cv::String const &,class cv::String const &)const " (?save@HOGDescriptor@cv@@UBEXABVString@2@0@Z)
1>MLSWarpImage.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall cv::HOGDescriptor::copyTo(struct cv::HOGDescriptor &)const " (?copyTo@HOGDescriptor@cv@@UBEXAAU12@@Z)
1>MLSWarpImage.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall cv::HOGDescriptor::compute(class cv::_InputArray const &,class std::vector<float,class std::allocator<float> > &,class cv::Size_<int>,class cv::Size_<int>,class std::vector<class cv::Point_<int>,class std::allocator<class cv::Point_<int> > > const &)const " (?compute@HOGDescriptor@cv@@UBEXABV_InputArray@2@AAV?$vector@MV?$allocator@M@std@@@std@@V?$Size_@H@2@2ABV?$vector@V?$Point_@H@cv@@V?$allocator@V?$Point_@H@cv@@@std@@@5@@Z)
1>MLSWarpImage.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall cv::HOGDescriptor::detect(class cv::Mat const &,class std::vector<class cv::Point_<int>,class std::allocator<class cv::Point_<int> > > &,double,class cv::Size_<int>,class cv::Size_<int>,class std::vector<class cv::Point_<int>,class std::allocator<class cv::Point_<int> > > const &)const " (?detect@HOGDescriptor@cv@@UBEXABVMat@2@AAV?$vector@V?$Point_@H@cv@@V?$allocator@V?$Point_@H@cv@@@std@@@std@@NV?$Size_@H@2@2ABV45@@Z)
1>MLSWarpImage.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall cv::HOGDescriptor::detect(class cv::Mat const &,class std::vector<class cv::Point_<int>,class std::allocator<class cv::Point_<int> > > &,class std::vector<double,class std::allocator<double> > &,double,class cv::Size_<int>,class cv::Size_<int>,class std::vector<class cv::Point_<int>,class std::allocator<class cv::Point_<int> > > const &)const " (?detect@HOGDescriptor@cv@@UBEXABVMat@2@AAV?$vector@V?$Point_@H@cv@@V?$allocator@V?$Point_@H@cv@@@std@@@std@@AAV?$vector@NV?$allocator@N@std@@@5@NV?$Size_@H@2@3ABV45@@Z)
1>MLSWarpImage.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall cv::HOGDescriptor::detectMultiScale(class cv::_InputArray const &,class std::vector<class cv::Rect_<int>,class std::allocator<class cv::Rect_<int> > > &,double,class cv::Size_<int>,class cv::Size_<int>,double,double,bool)const " (?detectMultiScale@HOGDescriptor@cv@@UBEXABV_InputArray@2@AAV?$vector@V?$Rect_@H@cv@@V?$allocator@V?$Rect_@H@cv@@@std@@@std@@NV?$Size_@H@2@2NN_N@Z)
1>MLSWarpImage.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall cv::HOGDescriptor::detectMultiScale(class cv::_InputArray const &,class std::vector<class cv::Rect_<int>,class std::allocator<class cv::Rect_<int> > > &,class std::vector<double,class std::allocator<double> > &,double,class cv::Size_<int>,class cv::Size_<int>,double,double,bool)const " (?detectMultiScale@HOGDescriptor@cv@@UBEXABV_InputArray@2@AAV?$vector@V?$Rect_@H@cv@@V?$allocator@V?$Rect_@H@cv@@@std@@@std@@AAV?$vector@NV?$allocator@N@std@@@5@NV?$Size_@H@2@3NN_N@Z)
1>MLSWarpImage.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall cv::HOGDescriptor::computeGradient(class cv::Mat const &,class cv::Mat &,class cv::Mat &,class cv::Size_<int>,class cv::Size_<int>)const " (?computeGradient@HOGDescriptor@cv@@UBEXABVMat@2@AAV32@1V?$Size_@H@2@2@Z)
1>MLSWarpImage.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall cv::HOGDescriptor::detectROI(class cv::Mat const &,class std::vector<class cv::Point_<int>,class std::allocator<class cv::Point_<int> > > const &,class std::vector<class cv::Point_<int>,class std::allocator<class cv::Point_<int> > > &,class std::vector<double,class std::allocator<double> > &,double,class cv::Size_<int>,class cv::Size_<int>)const " (?detectROI@HOGDescriptor@cv@@UBEXABVMat@2@ABV?$vector@V?$Point_@H@cv@@V?$allocator@V?$Point_@H@cv@@@std@@@std@@AAV45@AAV?$vector@NV?$allocator@N@std@@@5@NV?$Size_@H@2@4@Z)
1>MLSWarpImage.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall cv::HOGDescriptor::detectMultiScaleROI(class cv::Mat const &,class std::vector<class cv::Rect_<int>,class std::allocator<class cv::Rect_<int> > > &,class std::vector<struct cv::DetectionROI,class std::allocator<struct cv::DetectionROI> > &,double,int)const " (?detectMultiScaleROI@HOGDescriptor@cv@@UBEXABVMat@2@AAV?$vector@V?$Rect_@H@cv@@V?$allocator@V?$Rect_@H@cv@@@std@@@std@@AAV?$vector@UDetectionROI@cv@@V?$allocator@UDetectionROI@cv@@@std@@@5@NH@Z)
1>MLSWarpImage.obj : error LNK2019: unresolved external symbol "public: __thiscall cv::UMat::~UMat(void)" (??1UMat@cv@@$$FQAE@XZ) referenced in function "public: __thiscall cv::HOGDescriptor::HOGDescriptor(struct cv::HOGDescriptor const &)" (??0HOGDescriptor@cv@@$$FQAE@ABU01@@Z)
1>MLSWarpImage.obj : error LNK2019: unresolved external symbol "public: void __thiscall cv::Mat::deallocate(void)" (?deallocate@Mat@cv@@QAEXXZ) referenced in function "public: void __thiscall cv::Mat::release(void)" (?release@Mat@cv@@QAEXXZ)

1> C:\ Users \ aa \ Documents \ Visual Studio 2012 \ Projects \ Project2 \ Release \ Project2.exe:严重错误LNK1120:22个未解决的外部

将控制台应用程序更改为Windows以在窗口中显示输出图像时出现相同的错误。

opencv只能用于控制台应用程序或在gui应用程序中使用它的任何库。

编辑:

在我已包含在控制台中的属性中,

在控制台中:: Properties of console project

在Windows中: Properties of windows project

0 个答案:

没有答案