Ask Your Question
0

Android studio: undefined reference to cv::Stitcher

asked 2019-07-10 20:10:57 -0600

FanFM gravatar image

I am using opencv library. I want do

#include <jni.h>
#include <string>
#include "opencv2/opencv.hpp"
#include "opencv2/stitching.hpp"

using namespace std;
using namespace cv;
...
Ptr<cv::Stitcher> stitcher = Stitcher::create();

but I have error:

undefined reference to `cv::Stitcher::create(cv::Stitcher::Mode)'
edit retag flag offensive close merge delete

Comments

uhh, do you have libopencv_stitching.a or a.so there ? you need to link to that.

if you built opencv_java.so with BUILD_SHARED_LIBS=OFF,it probably won't get generated

berak gravatar imageberak ( 2020-04-07 09:37:50 -0600 )edit

1 answer

Sort by ยป oldest newest most voted
1

answered 2020-04-07 09:06:53 -0600

zelda gravatar image

you might have forgot to link the stitching lib , check your linker and add

-lopencv_stitching

edit flag offensive delete link more

Question Tools

2 followers

Stats

Asked: 2019-07-10 20:10:57 -0600

Seen: 652 times

Last updated: Apr 07 '20