Ask Your Question
0

unsovled externals errors occur when running detect_markers.cpp [closed]

asked 2019-01-05 16:53:08 -0500

czjczjczj1 gravatar image

updated 2019-01-05 21:05:48 -0500

berak gravatar image

When I ran detect_markers.cpp I got such errors, but it seemed that I have already included the header file for opencv4(the aruco header file were downloaded from this link https://github.com/opencv/opencv_cont...), added the path of the additional library directories, and the additional dependencies(opencv_world400d.lib for the debug and opencv_world400.lib for the release). Did I miss anything? Thanks for any help.

Severity    Code    Description Project File    Line    Suppression State
Error   LNK2019 unresolved external symbol "struct cv::Ptr<class cv::aruco::Dictionary> __cdecl cv::aruco::getPredefinedDictionary(enum cv::aruco::PREDEFINED_DICTIONARY_NAME)" (?getPredefinedDictionary@aruco@cv@@YA?AU?$Ptr@VDictionary@aruco@cv@@@2@W4PREDEFINED_DICTIONARY_NAME@12@@Z) referenced in function main Project2    E:\project\Project2\Project2\Source.obj 1   

Error   LNK2019 unresolved external symbol "public: static struct cv::Ptr<struct cv::aruco::DetectorParameters> __cdecl cv::aruco::DetectorParameters::create(void)" (?create@DetectorParameters@aruco@cv@@SA?AU?$Ptr@UDetectorParameters@aruco@cv@@@3@XZ) referenced in function main  Project2    E:\project\Project2\Project2\Source.obj 1   

Error   LNK2019 unresolved external symbol "void __cdecl cv::aruco::detectMarkers(class cv::debug_build_guard::_InputArray const &,struct cv::Ptr<class cv::aruco::Dictionary> const &,class cv::debug_build_guard::_OutputArray const &,class cv::debug_build_guard::_OutputArray const &,struct cv::Ptr<struct cv::aruco::DetectorParameters> const &,class cv::debug_build_guard::_OutputArray const &,class cv::debug_build_guard::_InputArray const &,class cv::debug_build_guard::_InputArray const &)" (?detectMarkers@aruco@cv@@YAXAEBV_InputArray@debug_build_guard@2@AEBU?$Ptr@VDictionary@aruco@cv@@@2@AEBV_OutputArray@42@2AEBU?$Ptr@UDetectorParameters@aruco@cv@@@2@200@Z) referenced in function main    Project2    E:\project\Project2\Project2\Source.obj 1   

Error   LNK2019 unresolved external symbol "void __cdecl cv::aruco::estimatePoseSingleMarkers(class cv::debug_build_guard::_InputArray const &,float,class cv::debug_build_guard::_InputArray const &,class cv::debug_build_guard::_InputArray const &,class cv::debug_build_guard::_OutputArray const &,class cv::debug_build_guard::_OutputArray const &,class cv::debug_build_guard::_OutputArray const &)" (?estimatePoseSingleMarkers@aruco@cv@@YAXAEBV_InputArray@debug_build_guard@2@M00AEBV_OutputArray@42@11@Z) referenced in function main    Project2    E:\project\Project2\Project2\Source.obj 1   

Error   LNK2019 unresolved external symbol "void __cdecl cv::aruco::drawDetectedMarkers(class cv::debug_build_guard::_InputOutputArray const &,class cv::debug_build_guard::_InputArray const &,class cv::debug_build_guard::_InputArray const &,class cv::Scalar_<double>)" (?drawDetectedMarkers@aruco@cv@@YAXAEBV_InputOutputArray@debug_build_guard@2@AEBV_InputArray@42@1V?$Scalar_@N@2@@Z) referenced in function main    Project2    E:\project\Project2\Project2\Source.obj 1   

Error   LNK2019 unresolved external symbol "void __cdecl cv::aruco::drawAxis(class cv::debug_build_guard::_InputOutputArray const &,class cv::debug_build_guard::_InputArray const &,class cv::debug_build_guard::_InputArray const &,class cv::debug_build_guard::_InputArray const &,class cv::debug_build_guard::_InputArray const &,float)" (?drawAxis@aruco@cv@@YAXAEBV_InputOutputArray@debug_build_guard@2@AEBV_InputArray@42@111M@Z) referenced in function main    Project2    E:\project\Project2\Project2\Source.obj 1   

Error   LNK1120 6 unresolved externals  Project2    E:\project\Project2\x64\Debug\Project2.exe  1
edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by czjczjczj1
close date 2019-01-06 08:55:32.557792

1 answer

Sort by ยป oldest newest most voted
0

answered 2019-01-06 02:36:45 -0500

berak gravatar image

you likely had to build the opencv (+ contrib) libs from source, and you should NOT build opencv_world, but seperate module libs then (like opencv_core, opencv_imgproc, etc) and link to those, not the old opencv_world one.

you also need to link against opencv_aruco now (that's the actual error in your question)

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2019-01-05 16:53:08 -0500

Seen: 20 times

Last updated: Jan 06