0

I'm trying out the ArUco marker detection in a Qt GUI project and so far I keep getting the error message

undefined reference to cv::aruco::getPredefinedDictionary(cv::aruco::PREDEFINED_DICTIONARY_NAME)

I'm following the steps here

I've tried making a fresh console project and copying the tutorial code from the ArUco module but all the aruco functions get undefined reference errors.

#include <opencv2/aruco.hpp>
...
using namespace cv;
using namespace std;
using namespace aruco;
...
Ptr<Dictionary> dictionary = getPredefinedDictionary(DICT_6X6_250);

Any help and/or advice would be much appreciated.

Shironats
  • 137
  • 6

2 Answers2

0

Found the answer to my problem. As Mohammed-Foly mentioned, I needed to add the ArUco library. The answer was in the second link he gave.

In the .pro file I simply added a line so it became something like this

INCLUDEPATH += "~/opencv-3.3.0/opencv/include"
INCLUDEPATH += "~/opencv-3.3.0/opencv/include/opencv"

LIBS += -L~/opencv-3.3.0/build/bin \
-lopencv_core \
-lopencv_highgui \
-lopencv_imgproc \
-lopencv_features2d \
-lopencv_calib3d \
-lopencv_video \
-lopencv_videoio \
-lopencv_aruco
Shironats
  • 137
  • 6
-1

it seems that the problem is in the library linking, make sure you installed aruco library.

here is some links may be helpful Aruco tutorial code does not compile https://answers.opencv.org/question/199256/aruco-drawmarker/

  • @PraveenSP my reputation is too low to add comment, so i had to ask in comment and same time i added my probably right answer – Mohamed-Foly Oct 26 '19 at 05:59