opencv3.1.0 programming In Qt5.5.1: error: undefined reference to `__atomic_fetch_add_4'

opencv3.1.0 programming In Qt5.5.1: error: undefined reference to `__atomic_fetch_add_4'

各位,我在ubuntu14.04上用Qt5.5.1编译了一个opencv小程序,遇到了一些麻烦。 首先我做了一个Qt Widgets Application,main.cpp代码如下:

#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

你能帮帮我吗?

也许我有一个解决方案:在我的 show.pro 文件中添加一行,如下所示

LIBS += /usr/lib/i386-linux-gnu/libatomic.so.1 

我试过了,没有错误。@Miki