#include <opencv2/opencv.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
using namespace cv;
int main()
{
Mat srcImage = imread("lena.jpg");
imshow("orig", srcImage);
waitKey(0);
return 0;
}
show.pro代码是:
#-------------------------------------------------
#
# Project created by QtCreator 2016-10-20T19:22:57
#
#-------------------------------------------------
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = show
TEMPLATE = app
SOURCES += main.cpp\
mainwindow.cpp
HEADERS += mainwindow.h
FORMS += mainwindow.ui
CONFIG += link_pkgconfig
PKGCONFIG += opencv
当我构建项目时,以下是错误:
/home/lmk/keke/build-show-Desktop_Qt_5_5_1_GCC_32bit-Debug/main.o:-1: In function `cv::Mat::release()':
/usr/local/opencv-3.1.0/include/opencv/opencv2/core/mat.inl.hpp:681: error: undefined reference to `__atomic_fetch_add_4'
:-1: error: collect2: error: ld returned 1 exit status
你能帮我吗?
答案 0 :(得分:0)
也许我有一个解决方案:在我的show.pro文件中添加一行,如下所示
LIBS += /usr/lib/i386-linux-gnu/libatomic.so.1
我试过,并且没有错误。@ Miki