0

I've built opencv2.framework using OpenCV 3.4 and opencv_contrib in order to use the aruco library. I'm importing this framework into Xcode and I am able to import and use standard OpenCV modules with no compile errors.

I can #import <aruco/aruco.h> with no compile errors. However, as soon as I try to use any classes from aruco I get a compile error. In this case:

Undefined symbols for aruco::MarkerDetector::~MarkerDetector()

#import <opencv2/opencv.hpp>
#import <opencv2/core.hpp>
#import <opencv2/imgcodecs/ios.h>
#import <opencv2/imgproc/imgproc.hpp>
#import <aruco/aruco.h>

-(void)doSomething() {
    //anything in cv:: lib is fine, no compile errors
    cv::Mat mat(3,3,CV_32); 

    //but as soon as I try to use aruco I get compile error
    aruco::MarkerDetector detector;

}
kalpesh satasiya
  • 799
  • 8
  • 18
nwales
  • 3,521
  • 2
  • 25
  • 47

1 Answers1

0

I got this working. If I include, vs import aruco - #include "opencv/aruco.hpp" I can then use aruco cv::aruco::detectMarkers(....).

For some reason when I import aruco, the code completion doesn't seem to accurately reflect the API and that was causing additional confusion.

nwales
  • 3,521
  • 2
  • 25
  • 47