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

青春壹個敷衍的年華 提交于 2019-12-13 16:21:14

问题


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.


回答1:


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



来源:https://stackoverflow.com/questions/52491314/undefined-reference-to-cvstringdeallocate-error-in-opencv-3-4-3

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!