OpenCV 3.4.3中未定义对`cv :: String :: deallocate()'错误的引用 [英] Undefined reference to `cv::String::deallocate()' error in OpenCV 3.4.3

查看:3501
本文介绍了OpenCV 3.4.3中未定义对`cv :: String :: deallocate()'错误的引用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近安装了OpenCV 3.4.3 但是OpenCV中的某些库没有运行.

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

这是我的示例代码.

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

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

这是我输入的评论

g ++ tmp.cpp

g++ tmp.cpp

结果如下.

/tmp/ccsulwjG.o:在函数cv::String::~String()': tmp.cpp:(.text._ZN2cv6StringD2Ev[_ZN2cv6StringD5Ev]+0x14): undefined reference to cv :: String :: deallocate()'中 /tmp/ccsulwjG.o:在函数cv::String::operator=(cv::String const&)': tmp.cpp:(.text._ZN2cv6StringaSERKS0_[_ZN2cv6StringaSERKS0_]+0x28): undefined reference to cv :: String :: deallocate()'中 collect2:错误:ld返回1退出状态

/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

然后在这种情况下如何获取exec文件? 我的ubuntu版本是14.04

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

谢谢.

推荐答案

您可能需要设置依赖项,例如-lopencv_core -lopencv_highgui -lopencv_imgproc

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

这篇关于OpenCV 3.4.3中未定义对`cv :: String :: deallocate()'错误的引用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆