Ask Your Question
1

Error Linking static libraries

asked 2019-05-29 10:13:47 -0600

mpp gravatar image

updated 2019-05-29 10:43:00 -0600

Hi, I built opencv from source and I'm trying to make a dll that uses some of the opencv .lib.

In visual studio I set the additional directory and dependencies as follows (.lib files are in that folder):

<AdditionalLibraryDirectories>[...]\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>

<additionaldependencies>opencv_core410.lib;opencv_imgcodecs410.lib;opencv_imgproc410.lib;%(AdditionalDependencies)</additionaldependencies>

When I build it I get these errors:

1>ImageProcessing.obj : error LNK2019: unresolved external symbol "class cv::debug_build_guard::_InputOutputArray const & __cdecl cv::noArray(void)" (?noArray@cv@@YAAEBV_InputOutputArray@debug_build_guard@1@XZ) referenced in function [...]
1>ImageProcessing.obj : error LNK2019: unresolved external symbol "public: void __cdecl cv::Mat::copyTo(class cv::debug_build_guard::_OutputArray const &)const " (?copyTo@Mat@cv@@QEBAXAEBV_OutputArray@debug_build_guard@2@@Z) referenced in function [...]
1>ImageProcessing.obj : error LNK2019: unresolved external symbol "public: void __cdecl cv::Mat::convertTo(class cv::debug_build_guard::_OutputArray const &,int,double,double)const " (?convertTo@Mat@cv@@QEBAXAEBV_OutputArray@debug_build_guard@2@HNN@Z) referenced in function[...]
1>ImageProcessing.obj : error LNK2019: unresolved external symbol "void __cdecl cv::bitwise_not(class cv::debug_build_guard::_InputArray const &,class cv::debug_build_guard::_OutputArray const &,class cv::debug_build_guard::_InputArray const &)" (?bitwise_not@cv@@YAXAEBV_InputArray@debug_build_guard@1@AEBV_OutputArray@31@0@Z) referenced in function "[...]
1>ImageProcessing.obj : error LNK2019: unresolved external symbol "bool __cdecl cv::imwrite(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class cv::debug_build_guard::_InputArray const &,class std::vector<int,class std::allocator<int> > const &)" (?imwrite@cv@@YA_NAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEBV_InputArray@debug_build_guard@1@AEBV?$vector@HV?$allocator@H@std@@@3@@Z) referenced in function [...]
1>ImageProcessing.obj : error LNK2019: unresolved external symbol "bool __cdecl cv::imencode(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &,class cv::debug_build_guard::_InputArray const &,class std::vector<unsigned char,class std::allocator<unsigned char> > &,class std::vector<int,class std::allocator<int> > const &)" (?imencode@cv@@YA_NAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEBV_InputArray@debug_build_guard@1@AEAV?$vector@EV?$allocator@E@std@@@3@AEBV?$vector@HV?$allocator@H@std@@@3@@Z) referenced in function [...]
1>ImageProcessing.obj : error LNK2019: unresolved external symbol "void __cdecl cv::GaussianBlur(class cv::debug_build_guard::_InputArray const &,class cv::debug_build_guard::_OutputArray const &,class cv::Size_<int>,double,double,int)" (?GaussianBlur@cv@@YAXAEBV_InputArray@debug_build_guard@1@AEBV_OutputArray@31@V?$Size_@H@1@NNH@Z) referenced in function [...]
1>ImageProcessing.obj : error LNK2019: unresolved external symbol "void __cdecl cv::warpAffine(class cv::debug_build_guard::_InputArray const &,class cv::debug_build_guard::_OutputArray const &,class cv::debug_build_guard::_InputArray const &,class cv::Size_<int>,int,int,class cv::Scalar_<double> const &)" (?warpAffine@cv@@YAXAEBV_InputArray@debug_build_guard@1@AEBV_OutputArray@31@0V?$Size_@H@1@HHAEBV?$Scalar_@N@1@@Z) referenced in function [...]
1>ImageProcessing.obj : error LNK2019: unresolved external symbol "void __cdecl cv::cvtColor(class cv::debug_build_guard::_InputArray const &,class cv::debug_build_guard::_OutputArray const &,int,int)" (?cvtColor@cv@@YAXAEBV_InputArray@debug_build_guard@1@AEBV_OutputArray@31@HH@Z) referenced in function [...]

Am I missing a dependency?

Any help is appreciated!

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
2

answered 2019-05-29 13:32:05 -0600

berak gravatar image

cv::debug_build_guard:: -- you're trying to build a DEBUG project, but link RELEASE opencv libs

you need opencv_core410d.lib, etc, in that configuration.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2019-05-29 10:11:54 -0600

Seen: 5,137 times

Last updated: May 29 '19