我有一个项目 - 项目A - 我编译为lib。 (发布模式MT VS12 c ++)。对于这个项目,我已经连接了OpenCV 300(静态模式),编译得很好,没有错误。
然后我有另一个项目 - 项目B - 具有与第一项相同的配置,它包含相同的OpenCV库和标题。 第二个项目B,还包括项目A(我有项目A标题和项目B的lib)。
然后当我编译项目B时,我得到以下错误
error LNK2001: unresolved external symbol "void __cdecl cv::circle(class cv::Mat &,class cv::Point_<int>,int,class cv::Scalar_<double> const &,int,int,int)" (?circle@cv@@YAXAAVMat@1@V?$Point_@H@1@HABV?$Scalar_@N@1@HHH@Z)
error LNK2001: unresolved external symbol "void __cdecl cv::line(class cv::Mat &,class cv::Point_<int>,class cv::Point_<int>,class cv::Scalar_<double> const &,int,int,int)" (?line@cv@@YAXAAVMat@1@V?$Point_@H@1@1ABV?$Scalar_@N@1@HHH@Z)
error LNK2001: unresolved external symbol "class cv::_OutputArray const & __cdecl cv::noArray(void)" (?noArray@cv@@YAABV_OutputArray@1@XZ)
error LNK2001: unresolved external symbol "int __cdecl cv::_interlockedExchangeAdd(int *,int)" (?_interlockedExchangeAdd@cv@@YAHPAHH@Z)
error LNK2001: unresolved external symbol "void __cdecl cv::normalize(class cv::_InputArray const &,class cv::_OutputArray const &,double,double,int,int,class cv::_InputArray const &)" (?normalize@cv@@YAXABV_InputArray@1@ABV_OutputArray@1@NNHH0@Z)
: error LNK2001: unresolved external symbol "void __cdecl cv::drawContours(class cv::_OutputArray const &,class cv::_InputArray const &,int,class cv::Scalar_<double> const &,int,int,class cv::_InputArray const &,int,class cv::Point_<int>)" (?drawContours@cv@@YAXABV_OutputArray@1@ABV_InputArray@1@HABV?$Scalar_@N@1@HH1HV?$Point_@H@1@@Z)
: error LNK2001: unresolved external symbol "public: virtual bool __thiscall cv::_InputArray::empty(void)const " (?empty@_InputArray@cv@@UBE_NXZ)
: error LNK2001: unresolved external symbol "public: virtual int __thiscall cv::_InputArray::channels(int)const " (?channels@_InputArray@cv@@UBEHH@Z)
: error LNK2001: unresolved external symbol "public: virtual int __thiscall cv::_InputArray::depth(int)const " (?depth@_InputArray@cv@@UBEHH@Z)
: error LNK2001: unresolved external symbol "public: virtual int __thiscall cv::_InputArray::type(int)const " (?type@_InputArray@cv@@UBEHH@Z)
: error LNK2001: unresolved external symbol "public: virtual unsigned int __thiscall cv::_InputArray::total(int)const " (?total@_InputArray@cv@@UBEIH@Z)
: error LNK2001: unresolved external symbol "public: virtual class cv::Size_<int> __thiscall cv::_InputArray::size(int)const " (?size@_InputArray@cv@@UBE?AV?$Size_@H@2@H@Z)
: error LNK2001: unresolved external symbol "public: virtual int __thiscall cv::_InputArray::kind(void)const " (?kind@_InputArray@cv@@UBEHXZ)
: error LNK2001: unresolved external symbol "public: virtual class cv::gpu::GpuMat __thiscall cv::_InputArray::getGpuMat(void)const " (?getGpuMat@_InputArray@cv@@UBE?AVGpuMat@gpu@2@XZ)
: error LNK2001: unresolved external symbol "public: virtual class cv::GlTexture __thiscall cv::_InputArray::getGlTexture(void)const " (?getGlTexture@_InputArray@cv@@UBE?AVGlTexture@2@XZ)
: error LNK2001: unresolved external symbol "public: virtual class cv::GlBuffer __thiscall cv::_InputArray::getGlBuffer(void)const " (?getGlBuffer@_InputArray@cv@@UBE?AVGlBuffer@2@XZ)
: error LNK2001: unresolved external symbol "public: virtual void __thiscall cv::_InputArray::getMatVector(class std::vector<class cv::Mat,class std::allocator<class cv::Mat> > &)const " (?getMatVector@_InputArray@cv@@UBEXAAV?$vector@VMat@cv@@V?$allocator@VMat@cv@@@std@@@std@@@Z)
: error LNK2001: unresolved external symbol "public: virtual class cv::Mat __thiscall cv::_InputArray::getMat(int)const " (?getMat@_InputArray@cv@@UBE?AVMat@2@H@Z)
: error LNK2001: unresolved external symbol "public: virtual void __thiscall cv::_OutputArray::clear(void)const " (?clear@_OutputArray@cv@@UBEXXZ)
: error LNK2001: unresolved external symbol "public: virtual void __thiscall cv::_OutputArray::release(void)const " (?release@_OutputArray@cv@@UBEXXZ)
: error LNK2001: unresolved external symbol "public: virtual void __thiscall cv::_OutputArray::create(class cv::Size_<int>,int,int,bool,int)const " (?create@_OutputArray@cv@@UBEXV?$Size_@H@2@HH_NH@Z)
: error LNK2001: unresolved external symbol "public: virtual void __thiscall cv::_OutputArray::create(int,int,int,int,bool,int)const " (?create@_OutputArray@cv@@UBEXHHHH_NH@Z)
: error LNK2001: unresolved external symbol "public: virtual void __thiscall cv::_OutputArray::create(int,int const *,int,int,bool,int)const " (?create@_OutputArray@cv@@UBEXHPBHHH_NH@Z)
: error LNK2001: unresolved external symbol "public: virtual class cv::Mat & __thiscall cv::_OutputArray::getMatRef(int)const " (?getMatRef@_OutputArray@cv@@UBEAAVMat@2@H@Z)
: error LNK2001: unresolved external symbol "public: virtual bool __thiscall cv::_OutputArray::needed(void)const " (?needed@_OutputArray@cv@@UBE_NXZ)
: error LNK2001: unresolved external symbol "public: virtual bool __thiscall cv::_OutputArray::fixedType(void)const " (?fixedType@_OutputArray@cv@@UBE_NXZ)
: error LNK2001: unresolved external symbol "public: virtual bool __thiscall cv::_OutputArray::fixedSize(void)const " (?fixedSize@_OutputArray@cv@@UBE_NXZ)
: error LNK2001: unresolved external symbol "void __cdecl cv::rectangle(class cv::Mat &,class cv::Point_<int>,class cv::Point_<int>,class cv::Scalar_<double> const &,int,int,int)" (?rectangle@cv@@YAXAAVMat@1@V?$Point_@H@1@1ABV?$Scalar_@N@1@HHH@Z)
: error LNK2001: unresolved external symbol "void __cdecl cv::findContours(class cv::_OutputArray const &,class cv::_OutputArray const &,class cv::_OutputArray const &,int,int,class cv::Point_<int>)" (?findContours@cv@@YAXABV_OutputArray@1@00HHV?$Point_@H@1@@Z)
: error LNK2001: unresolved external symbol "void __cdecl cv::imshow(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class cv::_InputArray const &)" (?imshow@cv@@YAXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@ABV_InputArray@1@@Z)
: error LNK2001: unresolved external symbol "int __cdecl cv::floodFill(class cv::_OutputArray const &,class cv::Point_<int>,class cv::Scalar_<double>,class cv::Rect_<int> *,class cv::Scalar_<double>,class cv::Scalar_<double>,int)" (?floodFill@cv@@YAHABV_OutputArray@1@V?$Point_@H@1@V?$Scalar_@N@1@PAV?$Rect_@H@1@22H@Z)
先谢谢!