Reputation: 180
I am trying to work with a depth sensor (PMD Camboard) and trying to show the captured depth image as a live stream. I can get the data from the sensor just fine. The problem starts as soon as I try to put in the OpenCV parts. Individually they work perfectly, but the problem starts as soon as I try to integrate them. I think the error is with the CMakeLists.txt, since even if I try to compile a simple program that just displays the webcam feed, without any of the depthsensor stuff, I get the same error. The said program works when I try to compile it with just the CMake for openCV.
EDIT: I tried systematically disabling parts of the CMake to see which parts exactly trigger the error and found that the line:
link_directories(${royale_LIB_DIR})
is the one that is causing the error.
I get the following errors when I try to compile:
/usr/local/lib/libopencv_highgui.so.3.1.0: undefined reference to `QWidget::isFullScreen() const@Qt_5'
/usr/local/lib/libopencv_cvv.so.3.1.0: undefined reference to `QAbstractSlider::setMinimum(int)@Qt_5'
/usr/local/lib/libopencv_highgui.so.3.1.0: undefined reference to `non-virtual thunk to QBoxLayout::minimumSize() const@Qt_5'
/usr/lib64/libQt5OpenGL.so.5: undefined reference to `QTransform::type() const@Qt_5'
/usr/local/lib/libopencv_cvv.so.3.1.0: undefined reference to `QWidget::hasHeightForWidth() const@Qt_5'
/usr/lib64/libQt5OpenGL.so.5: undefined reference to `QPen::color() const@Qt_5'
/usr/local/lib/libopencv_cvv.so.3.1.0: undefined reference to `QFrame::changeEvent(QEvent*)@Qt_5'
/usr/lib64/libQt5OpenGL.so.5: undefined reference to `QOpenGLMultiGroupSharedResource::insert(QOpenGLContext*, QOpenGLSharedResource*)@Qt_5_PRIVATE_API'
/usr/lib64/libQt5OpenGL.so.5: undefined reference to `QPaintDevice::~QPaintDevice()@Qt_5'
/usr/local/lib/libopencv_cvv.so.3.1.0: undefined reference to `QObject::QObject(QObject*)@Qt_5'
/usr/local/lib/libopencv_cvv.so.3.1.0: undefined reference to `QTabWidget::metaObject() const@Qt_5'
/usr/local/lib/libopencv_cvv.so.3.1.0: undefined reference to `QColorDialog::QColorDialog(QWidget*)@Qt_5'
/usr/local/lib/libopencv_highgui.so.3.1.0: undefined reference to `QFutureInterfaceBase::setThreadPool(QThreadPool*)@Qt_5'
/usr/lib64/libQt5OpenGL.so.5: undefined reference to
Full error at http://pastebin.com/KLKtzzSn
And my CMakeLists.txt is as follows:
cmake_minimum_required(VERSION 2.8)
set(CMAKE_PREFIX_PATH "share")
#project (depthDataCallBack)
project (webStream)
find_package(OpenCV REQUIRED)
find_package(royale REQUIRED)
link_directories(${royale_LIB_DIR})
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/inc)
add_executable(webStream webStream.cpp)
target_link_libraries(webStream ${OpenCV_LIBS})
target_link_libraries(webStream "${royale_LIBS}")
I'm new to CMake, having only been recently corrected. Any help would be appreciated.
Upvotes: 1
Views: 1726
Reputation: 8698
The list of errors shows that there is not Qt5 Widgets in linkage. Add the below lines to your CMakeLists.txt:
target_link_libraries(webStream Qt5::Widgets)
target_link_libraries(webStream Qt5::Core)
The other question is whether or not Qt 5 is installed in that system. Also read here: cmake doesn't link libGLU using QtOpenGL as long as there Qt OpenGL dependencies missing as well.
Upvotes: 1