IntelRealSense / librealsense

Intel® RealSense™ SDK
https://www.intelrealsense.com/
Apache License 2.0
7.61k stars 4.83k forks source link

How to run examples? #4205

Closed jorrit-g closed 5 years ago

jorrit-g commented 5 years ago

Required Info
Camera Model D435
Firmware Version 05.11.06.200
Operating System & Version Ubuntu 18.04
Kernel Version (Linux Only) 4.18.0-21-generic
Platform PC
SDK Version 2
Language C++
Segment

Issue Description

Hi There,

I'm having trouble running any other example than hello-realsense

What I have tried:

version:        1.1.1
srcversion:     B768DE770525128619C215B

Which does not include the "librealsense" string as the documentation says it should..

If then navigate to the rs-capture example, and modify the CMakeLists.txt to (removed the if statement and hardcoded the RUNTIME DESTINATION):

cmake_minimum_required(VERSION 3.1.0)

project(RealsenseExamplesCapture)

add_executable(rs-capture rs-capture.cpp ../example.hpp)
set_property(TARGET rs-capture PROPERTY CXX_STANDARD 11)
target_link_libraries(rs-capture ${DEPENDENCIES})
include_directories(rs-capture ../ ../../third-party/tclap/include)
set_target_properties (rs-capture PROPERTIES FOLDER "Examples")

install(TARGETS rs-capture RUNTIME DESTINATION bin)

and run a cmake . I see the following:

rs-capture.cpp:5:10: fatal error: example.hpp: No such file or directory
 #include "example.hpp"          // Include short list of convenience functions for rendering
          ^~~~~~~~~~~~~
compilation terminated.

which is leads me to conclude that I'm not understanding the build process correct.

I have tried running a cmake . in the root of the project but that gives errors in few of the examples projects about the DESTINATION DIR as well.

Im not familiar with Cmake in general. If you're willing to help me out with steps to take to get the examples running, i appreciate it highly.

jorrit-g commented 5 years ago

fixed after following instructions on installation guide