我正在尝试使用深度传感器(PMD Camboard)并尝试将捕获的深度图像显示为实时流。我可以很好地从传感器获取数据。一旦我尝试放入OpenCV部件,问题就开始了。他们个人工作得很好,但是一旦我尝试整合它们就会出现问题。我认为错误在于CMakeLists.txt,因为即使我尝试编译一个只显示网络摄像头源的简单程序,没有任何深度传感器的东西,我也会得到同样的错误。当我尝试使用CMake for openCV编译它时,所述程序有效。
编辑:我尝试系统地禁用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
的完整错误
我的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。任何帮助将不胜感激。
答案 0 :(得分:1)
错误列表显示链接中没有Qt5 Widgets。将以下行添加到CMakeLists.txt:
target_link_libraries(webStream Qt5::Widgets)
target_link_libraries(webStream Qt5::Core)
另一个问题是Qt 5是否安装在该系统中。 另请阅读:cmake doesn't link libGLU using QtOpenGL只要缺少Qt OpenGL依赖项。