8

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.

Justin
  • 91
  • 1
  • 1
  • 5

1 Answers1

6

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

galian
  • 832
  • 6
  • 12