在clion中编译librealsense时出错

时间:2016-11-02 11:10:06

标签: linux opencv cmake clion realsense

我有Ubuntu 16.04.1 LTS,我想整合"英特尔Reale Sense Library"进入clion。

所以我严格遵循以下指示:https://github.com/IntelRealSense/librealsense/blob/master/doc/installation.md

然后我安装了Clion并编辑了CMakeList.txt:

cmake_minimum_required(VERSION 3.6)
project(PAE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
find_package(OpenCV REQUIRED)
set(SOURCE_FILES main.cpp)
add_executable(PAE ${SOURCE_FILES})

include_directories(${OpenCV_INCLUDE_DIRS})
target_link_libraries(PAE ${OpenCV_LIBS})
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "~/librealsense/CMake/")
find_package(LibUSB REQUIRED)
include_directories(${LibUSB_INCLUDE_DIRS})
set(LIBS ${LIBS} ${LibUSB_LIBRARIES})
target_link_libraries(PAE ${LIBS})

但是当我尝试构建时,我收到以下错误:

CMakeFiles/PAE.dir/main.cpp.o: In Funktion `rs_apply_depth_control_preset(rs_device*, int)':
/usr/local/include/librealsense/rsutil.h:85: Nicht definierter Verweis auf `rs_set_device_options'
MakeFiles/PAE.dir/main.cpp.o: In Funktion `rs_apply_ivcam_preset(rs_device*, rs_ivcam_preset)':
/usr/local/include/librealsense/rsutil.h:128: Nicht definierter Verweis auf `rs_reset_device_options_to_default'
/usr/local/include/librealsense/rsutil.h:132: Nicht definierter Verweis auf `rs_set_device_options'
/usr/local/include/librealsense/rsutil.h:133: Nicht definierter Verweis auf `rs_set_device_options'
/usr/local/include/librealsense/rsutil.h:134: Nicht definierter Verweis auf `rs_set_device_options'

这是我的测试代码:

#include <iostream>
#include <opencv2/opencv.hpp>
#include <librealsense/rs.hpp>

using namespace std;
using namespace cv;

int main() {
    Mat image;
    image = imread("/home/philip/Bilder/r200.jpg", CV_LOAD_IMAGE_COLOR);

    if(! image.data )                          
    {
        cout <<  "Could not open or find the image" << std::endl ;
        return -1;
    }

    namedWindow( "Display window", WINDOW_AUTOSIZE );
    imshow( "Display window", image );                   

    waitKey(0);                                          
    return 0;
}

我是Linux新手,所以我不知道错误的原因是什么。我重新检查了我所做的所有设置,但我找不到错误。

0 个答案:

没有答案