Ask Your Question
0

fatal error LNK1215: metadata operation failed when include dnn from opencv in c++ project on visual studio 2015

asked 2018-12-04 06:00:09 -0600

I got a project(including subprojects) that i want to build. I build first all subprojects, whereas i build the main project i got this error: I use Debug mode on x64 machine. When i build i got these errors (45):

CapturingForm.obj : error LNK2001: unresolved external symbol "public: virtual bool __cdecl cv::dnn::experimental_dnn_34_v7::Layer::getMemoryShapes(class std::vector<class std::vector<int,class std::allocator<int> >,class std::allocator<class std::vector<int,class std::allocator<int> > > > const &,int,class std::vector<class std::vector<int,class std::allocator<int> >,class std::allocator<class std::vector<int,class std::allocator<int> > > > &,class std::vector<class std::vector<int,class std::allocator<int> >,class std::allocator<class std::vector<int,class std::allocator<int> > > > &)const " (?getMemoryShapes@Layer@experimental_dnn_34_v7@dnn@cv@@UEBA_NAEBV?$vector@V?$vector@HV?$allocator@H@std@@@std@@V?$allocator@V?$vector@HV?$allocator@H@std@@@std@@@2@@std@@HAEAV56@1@Z)
1>ViewersLibCore_d.lib(OpenCVViewer.obj) : error LNK2001: unresolved external symbol "public: virtual bool __cdecl 

cv::dnn::experimental_dnn_34_v7::Layer::getMemoryShapes(class std::vector<class std::vector<int,class std::allocator<int> >,class std::allocator<class std::vector<int,class std::allocator<int> > > > const &,int,class std::vector<class std::vector<int,class std::allocator<int> >,class std::allocator<class std::vector<int,class std::allocator<int> > > > &,class std::vector<class std::vector<int,class std::allocator<int> >,class std::allocator   15>LINK : fatal error LNK1215: metadata operation failed (8013119F) : 
+++
    .....

I suspect that something has to do with the opencv_dnn library, so i add it in additional dependencies of the project(+ the path). The problem is that, when i add opencv_dnn343.lib (Release mode) the errors reduced to 4 (from 45 that were before):

1>CalibrationGUI.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl cv::dnn::experimental_dnn_34_v7::Layer::forward(class cv::debug_build_guard::_InputArray const &,class cv::debug_build_guard::_OutputArray const &,class cv::debug_build_guard::_OutputArray const &)" (?forward@Layer@experimental_dnn_34_v7@dnn@cv@@UEAAXAEBV_InputArray@debug_build_guard@4@AEBV_OutputArray@64@1@Z)
1>subproj.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl cv::dnn::experimental_dnn_34_v7::Layer::forward(class cv::debug_build_guard::_InputArray const &,class cv::debug_build_guard::_OutputArray const &,class cv::debug_build_guard::_OutputArray const &)" (?forward@Layer@experimental_dnn_34_v7@dnn@cv@@UEAAXAEBV_InputArray@debug_build_guard@4@AEBV_OutputArray@64@1@Z)
1>ViewersLibsubproj_d.lib(OpenCVViewer.obj) : error LNK2001: unresolved external symbol "public: virtual void __cdecl cv::dnn::experimental_dnn_34_v7::Layer::forward(class cv::debug_build_guard::_InputArray const &,class cv::debug_build_guard::_OutputArray const &,class cv::debug_build_guard::_OutputArray const &)" (?forward@Layer@experimental_dnn_34_v7@dnn@cv@@UEAAXAEBV_InputArray@debug_build_guard@4@AEBV_OutputArray@64@1@Z)
1>Path\x64\Debug\MainProject.exe : fatal error LNK1120: 1 unresolved externals

But, when i add the opencv_dnn343d.lib (for Debug mode) , instead of eliminate the errors i got this error:

    MainProject.obj : error LNK2022: metadata operation failed (8013119F) : A TypeRef exists which should, but does not, have a corresponding TypeDef: (Impl): (0x01000038).
1>LINK : fatal error LNK1215: metadata operation failed (8013119F) :

I can't figure out a way for solving this. Any idea?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2018-12-04 06:14:17 -0600

berak gravatar image

updated 2018-12-04 06:15:16 -0600

please add DEBUG libs to a DEBUG project, and RELEASE libs to a RELEASE one.

opencv_dnn343d.lib

edit flag offensive delete link more

Comments

@berak i removed non -d- libraries from my projects. But the error remains the same.

jackal90 gravatar imagejackal90 ( 2018-12-04 06:24:50 -0600 )edit

no, it's not the same. (and i've NO idea, what you are doing)

(do we even know, if it is opencv related ?)

berak gravatar imageberak ( 2018-12-04 06:42:05 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2018-12-04 06:00:09 -0600

Seen: 848 times

Last updated: Dec 04 '18