Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Undefined reference to `cv::String::deallocate()' error in OpenCV 3.4.3 [duplicate]

Tags:

c++

opencv

g++

I recently installed OpenCV 3.4.3 But some libraries in OpenCV are not running.

This is my example code.

#include<iostream>
#include "opencv2/imgproc.hpp"
#include "opencv2/core.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/opencv.hpp"

int main(int argc, char** argv){
}

And this is the comment I entered

g++ tmp.cpp

And the results came out as follows.

/tmp/ccsulwjG.o: In function cv::String::~String()': tmp.cpp:(.text._ZN2cv6StringD2Ev[_ZN2cv6StringD5Ev]+0x14): undefined reference tocv::String::deallocate()' /tmp/ccsulwjG.o: In function cv::String::operator=(cv::String const&)': tmp.cpp:(.text._ZN2cv6StringaSERKS0_[_ZN2cv6StringaSERKS0_]+0x28): undefined reference tocv::String::deallocate()' collect2: error: ld returned 1 exit status

Then how can I get the exec file in this situation? My ubuntu version is 14.04

Thank you in advance.

like image 591
Justin Avatar asked Sep 25 '18 05:09

Justin


1 Answers

You may need to set dependency, like -lopencv_core -lopencv_highgui -lopencv_imgproc

like image 112
galian Avatar answered Nov 15 '22 14:11

galian