我正在尝试使用深度传感器(PMD Camboard),并尝试将捕获的深度图像显示为实况流。我可以很好地从传感器获取数据。当我尝试放入OpenCV部件时,问题就开始了。它们单独工作得很好,但当我尝试集成它们时,问题就开始了。我认为错误出在CMakeLists.txt上,因为即使我尝试编写一个简单的程序,只显示摄像头提要,而没有任何深度传感器的东西,我也会得到同样的错误。当我尝试用openCV的CMake编译它时,上述程序就可以工作了。
编辑:我尝试系统地禁用CMake的某些部分,以查看到底是哪些部分触发了错误,并发现下面这行代码:
link_directories(${royale_LIB_DIR})是导致错误的原因。
当我尝试编译时,我得到了以下错误:
/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 http://pastebin.com/KLKtzzSn出现完全错误
我的CMakeLists.txt如下:
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}")我刚接触过CMake,只做过recently corrected。任何帮助都将不胜感激。
发布于 2016-12-27 03:14:11
错误列表显示链接中没有Qt5小部件。将以下行添加到您的CMakeLists.txt:
target_link_libraries(webStream Qt5::Widgets)
target_link_libraries(webStream Qt5::Core)另一个问题是Qt5是否安装在该系统中。还可以在这里阅读:只要Qt OpenGL依赖项丢失,就可以使用cmake doesn't link libGLU using QtOpenGL。
https://stackoverflow.com/questions/41330498
复制相似问题