1 Reply Latest reply on Sep 5, 2018 2:06 PM by Intel Corporation

    Building examples (capture) realsense D435

    ramces

      Hi,

       

      I am experiencing problems when trying to build from source the examples provided by intel ( librealsense/examples at master · IntelRealSense/librealsense · GitHub  ) .

       

      Information about my pc/ setup :

      OS : Ubuntu 16.04 LTS

      Kernel: 4.15.0-33-generic

       

      History :

      First, I installed the realsense sdk following the instructions provided here librealsense/distribution_linux.md at master · IntelRealSense/librealsense · GitHub   and here librealsense/installation.md at master · IntelRealSense/librealsense · GitHub  , and have been able to run realsense-viewer without any issues.

      Then, I tried building the capture example. To do this I created a build directory inside examples/capture and run  :

           cmake ..  -DBUILD_GRAPHICAL_EXAMPLES=true , from examples/capture/build

      with the following output:

       

      -- The C compiler identification is GNU 5.4.0

      -- The CXX compiler identification is GNU 5.4.0

      -- Check for working C compiler: /usr/bin/cc

      -- Check for working C compiler: /usr/bin/cc -- works

      -- Detecting C compiler ABI info

      -- Detecting C compiler ABI info - done

      -- Detecting C compile features

      -- Detecting C compile features - done

      -- Check for working CXX compiler: /usr/bin/c++

      -- Check for working CXX compiler: /usr/bin/c++ -- works

      -- Detecting CXX compiler ABI info

      -- Detecting CXX compiler ABI info - done

      -- Detecting CXX compile features

      -- Detecting CXX compile features - done

      -- Performing Test COMPILER_SUPPORTS_CXX11

      -- Performing Test COMPILER_SUPPORTS_CXX11 - Success

      -- Performing Test COMPILER_SUPPORTS_CXX0X

      -- Performing Test COMPILER_SUPPORTS_CXX0X - Success

      -- Configuring done

      -- Generating done

      -- Build files have been written to: /home/awdw/realsense_install/librealsense/examples/capture/build

      Then I run :

      make

      with the following output:

       

      Scanning dependencies of target rs-capture

      [ 50%] Building CXX object CMakeFiles/rs-capture.dir/rs-capture.cpp.o

      In file included from /home/awdw/realsense_install/librealsense/examples/capture/rs-capture.cpp:5:0:

      /home/awdw/realsense_install/librealsense/examples/capture/../example.hpp: In member function ‘rect texture::calc_grid(float2, int)’:

      /home/awdw/realsense_install/librealsense/examples/capture/../example.hpp:189:40: warning: narrowing conversion of ‘w’ from ‘double’ to ‘float’ inside { } [-Wnarrowing]

               return rect{ w, h, new_w, new_h}; //column count, line count, cell width cell height

                                              ^

      /home/awdw/realsense_install/librealsense/examples/capture/../example.hpp:189:40: warning: narrowing conversion of ‘h’ from ‘double’ to ‘float’ inside { } [-Wnarrowing]

      /home/awdw/realsense_install/librealsense/examples/capture/../example.hpp:189:40: warning: narrowing conversion of ‘new_w’ from ‘double’ to ‘float’ inside { } [-Wnarrowing]

      /home/awdw/realsense_install/librealsense/examples/capture/../example.hpp:189:40: warning: narrowing conversion of ‘new_h’ from ‘double’ to ‘float’ inside { } [-Wnarrowing]

      [100%] Linking CXX executable rs-capture

      CMakeFiles/rs-capture.dir/rs-capture.cpp.o: In function `draw_pointcloud(float, float, glfw_state&, rs2::points&)':

      rs-capture.cpp:(.text+0x647): undefined reference to `glPopMatrix'

      rs-capture.cpp:(.text+0x651): undefined reference to `glPushAttrib'

      rs-capture.cpp:(.text+0x676): undefined reference to `glClearColor'

      rs-capture.cpp:(.text+0x680): undefined reference to `glClear'

      rs-capture.cpp:(.text+0x68a): undefined reference to `glMatrixMode'

      rs-capture.cpp:(.text+0x68f): undefined reference to `glPushMatrix'

      rs-capture.cpp:(.text+0x6d1): undefined reference to `gluPerspective'

      rs-capture.cpp:(.text+0x6db): undefined reference to `glMatrixMode'

      rs-capture.cpp:(.text+0x6e0): undefined reference to `glPushMatrix'

      rs-capture.cpp:(.text+0x71f): undefined reference to `gluLookAt'

      rs-capture.cpp:(.text+0x754): undefined reference to `glTranslatef'

      rs-capture.cpp:(.text+0x77a): undefined reference to `glRotated'

      rs-capture.cpp:(.text+0x79f): undefined reference to `glRotated'

      rs-capture.cpp:(.text+0x7b4): undefined reference to `glTranslatef'

      rs-capture.cpp:(.text+0x7ca): undefined reference to `glPointSize'

      rs-capture.cpp:(.text+0x7d4): undefined reference to `glEnable'

      rs-capture.cpp:(.text+0x7de): undefined reference to `glEnable'

      rs-capture.cpp:(.text+0x7fa): undefined reference to `glBindTexture'

      rs-capture.cpp:(.text+0x844): undefined reference to `glTexParameterfv'

      rs-capture.cpp:(.text+0x858): undefined reference to `glTexParameteri'

      rs-capture.cpp:(.text+0x86c): undefined reference to `glTexParameteri'

      rs-capture.cpp:(.text+0x876): undefined reference to `glBegin'

      rs-capture.cpp:(.text+0x91e): undefined reference to `glVertex3fv'

      rs-capture.cpp:(.text+0x942): undefined reference to `glTexCoord2fv'

      rs-capture.cpp:(.text+0x950): undefined reference to `glEnd'

      rs-capture.cpp:(.text+0x955): undefined reference to `glPopMatrix'

      rs-capture.cpp:(.text+0x95f): undefined reference to `glMatrixMode'

      rs-capture.cpp:(.text+0x964): undefined reference to `glPopMatrix'

      rs-capture.cpp:(.text+0x969): undefined reference to `glPopAttrib'

      rs-capture.cpp:(.text+0x96e): undefined reference to `glPushMatrix'

      CMakeFiles/rs-capture.dir/rs-capture.cpp.o: In function `rs2::error::error(rs2_error*)':

      rs-capture.cpp:(.text._ZN3rs25errorC2EP9rs2_error[_ZN3rs25errorC5EP9rs2_error]+0x2a): undefined reference to `rs2_get_error_message'

      rs-capture.cpp:(.text._ZN3rs25errorC2EP9rs2_error[_ZN3rs25errorC5EP9rs2_error]+0x74): undefined reference to `rs2_get_failed_function'

      rs-capture.cpp:(.text._ZN3rs25errorC2EP9rs2_error[_ZN3rs25errorC5EP9rs2_error]+0x9b): undefined reference to `rs2_get_failed_function'

      rs-capture.cpp:(.text._ZN3rs25errorC2EP9rs2_error[_ZN3rs25errorC5EP9rs2_error]+0x102): undefined reference to `rs2_get_failed_args'

      rs-capture.cpp:(.text._ZN3rs25errorC2EP9rs2_error[_ZN3rs25errorC5EP9rs2_error]+0x129): undefined reference to `rs2_get_failed_args'

      rs-capture.cpp:(.text._ZN3rs25errorC2EP9rs2_error[_ZN3rs25errorC5EP9rs2_error]+0x190): undefined reference to `rs2_get_librealsense_exception_type'

      rs-capture.cpp:(.text._ZN3rs25errorC2EP9rs2_error[_ZN3rs25errorC5EP9rs2_error]+0x1a5): undefined reference to `rs2_free_error'

      CMakeFiles/rs-capture.dir/rs-capture.cpp.o: In function `rs2::error::handle(rs2_error*)':

      rs-capture.cpp:(.text._ZN3rs25error6handleEP9rs2_error[_ZN3rs25error6handleEP9rs2_error]+0x22): undefined reference to `rs2_get_librealsense_exception_type'

      CMakeFiles/rs-capture.dir/rs-capture.cpp.o: In function `rs2::stream_profile::stream_profile(rs2_stream_profile const*)':

      rs-capture.cpp:(.text._ZN3rs214stream_profileC2EPK18rs2_stream_profile[_ZN3rs214stream_profileC5EPK18rs2_stream_profile]+0xc1): undefined reference to `rs2_get_stream_profile_data'

      rs-capture.cpp:(.text._ZN3rs214stream_profileC2EPK18rs2_stream_profile[_ZN3rs214stream_profileC5EPK18rs2_stream_profile]+0xe7): undefined reference to `rs2_is_stream_profile_default'

      CMakeFiles/rs-capture.dir/rs-capture.cpp.o: In function `rs2::frame::~frame()':

      rs-capture.cpp:(.text._ZN3rs25frameD2Ev[_ZN3rs25frameD5Ev]+0x23): undefined reference to `rs2_release_frame'

      CMakeFiles/rs-capture.dir/rs-capture.cpp.o: In function `rs2::frame::get_data() const':

      rs-capture.cpp:(.text._ZNK3rs25frame8get_dataEv[_ZNK3rs25frame8get_dataEv]+0x35): undefined reference to `rs2_get_frame_data'

      CMakeFiles/rs-capture.dir/rs-capture.cpp.o: In function `rs2::frame::get_profile() const':

      rs-capture.cpp:(.text._ZNK3rs25frame11get_profileEv[_ZNK3rs25frame11get_profileEv]+0x39): undefined reference to `rs2_get_frame_stream_profile'

      CMakeFiles/rs-capture.dir/rs-capture.cpp.o: In function `rs2::frame::add_ref() const':

      rs-capture.cpp:(.text._ZNK3rs25frame7add_refEv[_ZNK3rs25frame7add_refEv]+0x35): undefined reference to `rs2_frame_add_ref'

      CMakeFiles/rs-capture.dir/rs-capture.cpp.o: In function `rs2::frame::reset()':

      rs-capture.cpp:(.text._ZN3rs25frame5resetEv[_ZN3rs25frame5resetEv]+0x23): undefined reference to `rs2_release_frame'

      CMakeFiles/rs-capture.dir/rs-capture.cpp.o: In function `rs2::video_frame::video_frame(rs2::frame const&)':

      rs-capture.cpp:(.text._ZN3rs211video_frameC2ERKNS_5frameE[_ZN3rs211video_frameC5ERKNS_5frameE]+0x6d): undefined reference to `rs2_is_frame_extendable_to'

      CMakeFiles/rs-capture.dir/rs-capture.cpp.o: In function `rs2::video_frame::get_width() const':

      rs-capture.cpp:(.text._ZNK3rs211video_frame9get_widthEv[_ZNK3rs211video_frame9get_widthEv]+0x3d): undefined reference to `rs2_get_frame_width'

      CMakeFiles/rs-capture.dir/rs-capture.cpp.o: In function `rs2::video_frame::get_height() const':

      rs-capture.cpp:(.text._ZNK3rs211video_frame10get_heightEv[_ZNK3rs211video_frame10get_heightEv]+0x3d): undefined reference to `rs2_get_frame_height'

      CMakeFiles/rs-capture.dir/rs-capture.cpp.o: In function `rs2::points::get_vertices() const':

      rs-capture.cpp:(.text._ZNK3rs26points12get_verticesEv[_ZNK3rs26points12get_verticesEv]+0x3d): undefined reference to `rs2_get_frame_vertices'

      CMakeFiles/rs-capture.dir/rs-capture.cpp.o: In function `rs2::points::get_texture_coordinates() const':

      rs-capture.cpp:(.text._ZNK3rs26points23get_texture_coordinatesEv[_ZNK3rs26points23get_texture_coordinatesEv]+0x3d): undefined reference to `rs2_get_frame_texture_coordinates'

      CMakeFiles/rs-capture.dir/rs-capture.cpp.o: In function `rs2::depth_frame::depth_frame(rs2::frame const&)':

      rs-capture.cpp:(.text._ZN3rs211depth_frameC2ERKNS_5frameE[_ZN3rs211depth_frameC5ERKNS_5frameE]+0x6d): undefined reference to `rs2_is_frame_extendable_to'

      CMakeFiles/rs-capture.dir/rs-capture.cpp.o: In function `rs2::frameset::frameset(rs2::frame const&)':

      rs-capture.cpp:(.text._ZN3rs28framesetC2ERKNS_5frameE[_ZN3rs28framesetC5ERKNS_5frameE]+0x79): undefined reference to `rs2_is_frame_extendable_to'

      rs-capture.cpp:(.text._ZN3rs28framesetC2ERKNS_5frameE[_ZN3rs28framesetC5ERKNS_5frameE]+0xea): undefined reference to `rs2_embedded_frames_count'

      CMakeFiles/rs-capture.dir/rs-capture.cpp.o: In function `rs2::frame_queue::frame_queue(unsigned int)':

      rs-capture.cpp:(.text._ZN3rs211frame_queueC2Ej[_ZN3rs211frame_queueC5Ej]+0x4b): undefined reference to `rs2_create_frame_queue'

      rs-capture.cpp:(.text._ZN3rs211frame_queueC2Ej[_ZN3rs211frame_queueC5Ej]+0x57): undefined reference to `rs2_delete_frame_queue'

      CMakeFiles/rs-capture.dir/rs-capture.cpp.o: In function `rs2::frame_queue::enqueue(rs2::frame) const':

      rs-capture.cpp:(.text._ZNK3rs211frame_queue7enqueueENS_5frameE[_ZNK3rs211frame_queue7enqueueENS_5frameE]+0x2d): undefined reference to `rs2_enqueue_frame'

      CMakeFiles/rs-capture.dir/rs-capture.cpp.o: In function `rs2::processing_block::invoke(rs2::frame) const':

      rs-capture.cpp:(.text._ZNK3rs216processing_block6invokeENS_5frameE[_ZNK3rs216processing_block6invokeENS_5frameE]+0x6f): undefined reference to `rs2_process_frame'

      CMakeFiles/rs-capture.dir/rs-capture.cpp.o: In function `rs2::colorizer::init()':

      rs-capture.cpp:(.text._ZN3rs29colorizer4initEv[_ZN3rs29colorizer4initEv]+0x30): undefined reference to `rs2_create_colorizer'

      rs-capture.cpp:(.text._ZN3rs29colorizer4initEv[_ZN3rs29colorizer4initEv]+0x3c): undefined reference to `rs2_delete_processing_block'

      CMakeFiles/rs-capture.dir/rs-capture.cpp.o: In function `rs2::context::context()':

      rs-capture.cpp:(.text._ZN3rs27contextC2Ev[_ZN3rs27contextC5Ev]+0x3d): undefined reference to `rs2_create_context'

      rs-capture.cpp:(.text._ZN3rs27contextC2Ev[_ZN3rs27contextC5Ev]+0x49): undefined reference to `rs2_delete_context'

      CMakeFiles/rs-capture.dir/rs-capture.cpp.o: In function `rs2::pipeline::pipeline(rs2::context)':

      rs-capture.cpp:(.text._ZN3rs28pipelineC2ENS_7contextE[_ZN3rs28pipelineC5ENS_7contextE]+0x4e): undefined reference to `rs2_create_pipeline'

      rs-capture.cpp:(.text._ZN3rs28pipelineC2ENS_7contextE[_ZN3rs28pipelineC5ENS_7contextE]+0x5a): undefined reference to `rs2_delete_pipeline'

      CMakeFiles/rs-capture.dir/rs-capture.cpp.o: In function `rs2::pipeline::start()':

      rs-capture.cpp:(.text._ZN3rs28pipeline5startEv[_ZN3rs28pipeline5startEv]+0x42): undefined reference to `rs2_pipeline_start'

      rs-capture.cpp:(.text._ZN3rs28pipeline5startEv[_ZN3rs28pipeline5startEv]+0x4e): undefined reference to `rs2_delete_pipeline_profile'

      CMakeFiles/rs-capture.dir/rs-capture.cpp.o: In function `rs2::pipeline::wait_for_frames(unsigned int) const':

      rs-capture.cpp:(.text._ZNK3rs28pipeline15wait_for_framesEj[_ZNK3rs28pipeline15wait_for_framesEj]+0x47): undefined reference to `rs2_pipeline_wait_for_frames'

      CMakeFiles/rs-capture.dir/rs-capture.cpp.o: In function `rs2::log_to_console(rs2_log_severity)':

      rs-capture.cpp:(.text._ZN3rs214log_to_consoleE16rs2_log_severity[_ZN3rs214log_to_consoleE16rs2_log_severity]+0x2f): undefined reference to `rs2_log_to_console'

      CMakeFiles/rs-capture.dir/rs-capture.cpp.o: In function `draw_text(int, int, char const*)':

      rs-capture.cpp:(.text._Z9draw_textiiPKc[_Z9draw_textiiPKc]+0x33): undefined reference to `glEnableClientState'

      rs-capture.cpp:(.text._Z9draw_textiiPKc[_Z9draw_textiiPKc]+0x51): undefined reference to `glVertexPointer'

      rs-capture.cpp:(.text._Z9draw_textiiPKc[_Z9draw_textiiPKc]+0xa2): undefined reference to `glDrawArrays'

      rs-capture.cpp:(.text._Z9draw_textiiPKc[_Z9draw_textiiPKc]+0xac): undefined reference to `glDisableClientState'

      CMakeFiles/rs-capture.dir/rs-capture.cpp.o: In function `texture::upload(rs2::video_frame const&)':

      rs-capture.cpp:(.text._ZN7texture6uploadERKN3rs211video_frameE[_ZN7texture6uploadERKN3rs211video_frameE]+0x50): undefined reference to `glGenTextures'

      rs-capture.cpp:(.text._ZN7texture6uploadERKN3rs211video_frameE[_ZN7texture6uploadERKN3rs211video_frameE]+0x55): undefined reference to `glGetError'

      rs-capture.cpp:(.text._ZN7texture6uploadERKN3rs211video_frameE[_ZN7texture6uploadERKN3rs211video_frameE]+0xf6): undefined reference to `glBindTexture'

      rs-capture.cpp:(.text._ZN7texture6uploadERKN3rs211video_frameE[_ZN7texture6uploadERKN3rs211video_frameE]+0x15b): undefined reference to `glTexImage2D'

      rs-capture.cpp:(.text._ZN7texture6uploadERKN3rs211video_frameE[_ZN7texture6uploadERKN3rs211video_frameE]+0x1af): undefined reference to `glTexImage2D'

      rs-capture.cpp:(.text._ZN7texture6uploadERKN3rs211video_frameE[_ZN7texture6uploadERKN3rs211video_frameE]+0x200): undefined reference to `glTexImage2D'

      rs-capture.cpp:(.text._ZN7texture6uploadERKN3rs211video_frameE[_ZN7texture6uploadERKN3rs211video_frameE]+0x246): undefined reference to `glTexParameteri'

      rs-capture.cpp:(.text._ZN7texture6uploadERKN3rs211video_frameE[_ZN7texture6uploadERKN3rs211video_frameE]+0x25a): undefined reference to `glTexParameteri'

      rs-capture.cpp:(.text._ZN7texture6uploadERKN3rs211video_frameE[_ZN7texture6uploadERKN3rs211video_frameE]+0x26e): undefined reference to `glTexParameteri'

      rs-capture.cpp:(.text._ZN7texture6uploadERKN3rs211video_frameE[_ZN7texture6uploadERKN3rs211video_frameE]+0x282): undefined reference to `glTexParameteri'

      rs-capture.cpp:(.text._ZN7texture6uploadERKN3rs211video_frameE[_ZN7texture6uploadERKN3rs211video_frameE]+0x291): undefined reference to `glPixelStorei'

      rs-capture.cpp:(.text._ZN7texture6uploadERKN3rs211video_frameE[_ZN7texture6uploadERKN3rs211video_frameE]+0x2a0): undefined reference to `glBindTexture'

      CMakeFiles/rs-capture.dir/rs-capture.cpp.o: In function `texture::show(rect const&) const':

      rs-capture.cpp:(.text._ZNK7texture4showERK4rect[_ZNK7texture4showERK4rect]+0x2c): undefined reference to `glBindTexture'

      rs-capture.cpp:(.text._ZNK7texture4showERK4rect[_ZNK7texture4showERK4rect]+0x36): undefined reference to `glEnable'

      rs-capture.cpp:(.text._ZNK7texture4showERK4rect[_ZNK7texture4showERK4rect]+0x40): undefined reference to `glBegin'

      rs-capture.cpp:(.text._ZNK7texture4showERK4rect[_ZNK7texture4showERK4rect]+0x51): undefined reference to `glTexCoord2f'

      rs-capture.cpp:(.text._ZNK7texture4showERK4rect[_ZNK7texture4showERK4rect]+0x7d): undefined reference to `glVertex2f'

      rs-capture.cpp:(.text._ZNK7texture4showERK4rect[_ZNK7texture4showERK4rect]+0x8a): undefined reference to `glTexCoord2f'

      rs-capture.cpp:(.text._ZNK7texture4showERK4rect[_ZNK7texture4showERK4rect]+0xa9): undefined reference to `glVertex2f'

      rs-capture.cpp:(.text._ZNK7texture4showERK4rect[_ZNK7texture4showERK4rect]+0xbe): undefined reference to `glTexCoord2f'

      rs-capture.cpp:(.text._ZNK7texture4showERK4rect[_ZNK7texture4showERK4rect]+0xf4): undefined reference to `glVertex2f'

      rs-capture.cpp:(.text._ZNK7texture4showERK4rect[_ZNK7texture4showERK4rect]+0x105): undefined reference to `glTexCoord2f'

      rs-capture.cpp:(.text._ZNK7texture4showERK4rect[_ZNK7texture4showERK4rect]+0x12b): undefined reference to `glVertex2f'

      rs-capture.cpp:(.text._ZNK7texture4showERK4rect[_ZNK7texture4showERK4rect]+0x130): undefined reference to `glEnd'

      rs-capture.cpp:(.text._ZNK7texture4showERK4rect[_ZNK7texture4showERK4rect]+0x13a): undefined reference to `glDisable'

      rs-capture.cpp:(.text._ZNK7texture4showERK4rect[_ZNK7texture4showERK4rect]+0x149): undefined reference to `glBindTexture'

      rs-capture.cpp:(.text._ZNK7texture4showERK4rect[_ZNK7texture4showERK4rect]+0x157): undefined reference to `rs2_stream_to_string'

      CMakeFiles/rs-capture.dir/rs-capture.cpp.o: In function `window::window(int, int, char const*)::{lambda(GLFWwindow*, int, int, int)#1}::operator()(GLFWwindow*, int, int, int) const':

      rs-capture.cpp:(.text._ZZN6windowC4EiiPKcENKUlP10GLFWwindowiiiE_clES3_iii[_ZZN6windowC4EiiPKcENKUlP10GLFWwindowiiiE_clES3_iii]+0x22): undefined reference to `glfwGetWindowUserPointer'

      CMakeFiles/rs-capture.dir/rs-capture.cpp.o: In function `window::window(int, int, char const*)::{lambda(GLFWwindow*, double, double)#2}::operator()(GLFWwindow*, double, double) const':

      rs-capture.cpp:(.text._ZZN6windowC4EiiPKcENKUlP10GLFWwindowddE0_clES3_dd[_ZZN6windowC4EiiPKcENKUlP10GLFWwindowddE0_clES3_dd]+0x22): undefined reference to `glfwGetWindowUserPointer'

      CMakeFiles/rs-capture.dir/rs-capture.cpp.o: In function `window::window(int, int, char const*)::{lambda(GLFWwindow*, double, double)#3}::operator()(GLFWwindow*, double, double) const':

      rs-capture.cpp:(.text._ZZN6windowC4EiiPKcENKUlP10GLFWwindowddE1_clES3_dd[_ZZN6windowC4EiiPKcENKUlP10GLFWwindowddE1_clES3_dd]+0x22): undefined reference to `glfwGetWindowUserPointer'

      CMakeFiles/rs-capture.dir/rs-capture.cpp.o: In function `window::window(int, int, char const*)::{lambda(GLFWwindow*, int, int, int, int)#4}::operator()(GLFWwindow*, int, int, int, int) const':

      rs-capture.cpp:(.text._ZZN6windowC4EiiPKcENKUlP10GLFWwindowiiiiE2_clES3_iiii[_ZZN6windowC4EiiPKcENKUlP10GLFWwindowiiiiE2_clES3_iiii]+0x26): undefined reference to `glfwGetWindowUserPointer'

      CMakeFiles/rs-capture.dir/rs-capture.cpp.o: In function `window::window(int, int, char const*)':

      rs-capture.cpp:(.text._ZN6windowC2EiiPKc[_ZN6windowC5EiiPKc]+0xa8): undefined reference to `glfwInit'

      rs-capture.cpp:(.text._ZN6windowC2EiiPKc[_ZN6windowC5EiiPKc]+0xc4): undefined reference to `glfwCreateWindow'

      rs-capture.cpp:(.text._ZN6windowC2EiiPKc[_ZN6windowC5EiiPKc]+0x121): undefined reference to `glfwMakeContextCurrent'

      rs-capture.cpp:(.text._ZN6windowC2EiiPKc[_ZN6windowC5EiiPKc]+0x13b): undefined reference to `glfwSetWindowUserPointer'

      rs-capture.cpp:(.text._ZN6windowC2EiiPKc[_ZN6windowC5EiiPKc]+0x160): undefined reference to `glfwSetMouseButtonCallback'

      rs-capture.cpp:(.text._ZN6windowC2EiiPKc[_ZN6windowC5EiiPKc]+0x185): undefined reference to `glfwSetScrollCallback'

      rs-capture.cpp:(.text._ZN6windowC2EiiPKc[_ZN6windowC5EiiPKc]+0x1aa): undefined reference to `glfwSetCursorPosCallback'

      rs-capture.cpp:(.text._ZN6windowC2EiiPKc[_ZN6windowC5EiiPKc]+0x1cf): undefined reference to `glfwSetKeyCallback'

      CMakeFiles/rs-capture.dir/rs-capture.cpp.o: In function `window::operator bool()':

      rs-capture.cpp:(.text._ZN6windowcvbEv[_ZN6windowcvbEv]+0xd): undefined reference to `glPopMatrix'

      rs-capture.cpp:(.text._ZN6windowcvbEv[_ZN6windowcvbEv]+0x20): undefined reference to `glfwSwapBuffers'

      rs-capture.cpp:(.text._ZN6windowcvbEv[_ZN6windowcvbEv]+0x33): undefined reference to `glfwWindowShouldClose'

      rs-capture.cpp:(.text._ZN6windowcvbEv[_ZN6windowcvbEv]+0x40): undefined reference to `glfwPollEvents'

      rs-capture.cpp:(.text._ZN6windowcvbEv[_ZN6windowcvbEv]+0x6c): undefined reference to `glfwGetFramebufferSize'

      rs-capture.cpp:(.text._ZN6windowcvbEv[_ZN6windowcvbEv]+0x76): undefined reference to `glClear'

      rs-capture.cpp:(.text._ZN6windowcvbEv[_ZN6windowcvbEv]+0x9d): undefined reference to `glViewport'

      rs-capture.cpp:(.text._ZN6windowcvbEv[_ZN6windowcvbEv]+0xa2): undefined reference to `glPushMatrix'

      rs-capture.cpp:(.text._ZN6windowcvbEv[_ZN6windowcvbEv]+0xce): undefined reference to `glfwGetWindowSize'

      rs-capture.cpp:(.text._ZN6windowcvbEv[_ZN6windowcvbEv]+0x117): undefined reference to `glOrtho'

      CMakeFiles/rs-capture.dir/rs-capture.cpp.o: In function `window::~window()':

      rs-capture.cpp:(.text._ZN6windowD2Ev[_ZN6windowD5Ev]+0x1b): undefined reference to `glfwDestroyWindow'

      rs-capture.cpp:(.text._ZN6windowD2Ev[_ZN6windowD5Ev]+0x20): undefined reference to `glfwTerminate'

      CMakeFiles/rs-capture.dir/rs-capture.cpp.o: In function `void rs2::frameset::foreach<rs2::frameset::first_or_default(rs2_stream, rs2_format) const::{lambda(rs2::frame)#1}>(rs2::frameset::first_or_default(rs2_stream, rs2_format) const::{lambda(rs2::frame)#1}) const':

      rs-capture.cpp:(.text._ZNK3rs28frameset7foreachIZNKS0_16first_or_defaultE10rs2_stream10rs2_formatEUlNS_5frameEE_EEvT_[_ZNK3rs28frameset7foreachIZNKS0_16first_or_defaultE10rs2_stream10rs2_formatEUlNS_5frameEE_EEvT_]+0x7d): undefined reference to `rs2_extract_frame'

      CMakeFiles/rs-capture.dir/rs-capture.cpp.o: In function `void rs2::frameset::foreach<rs2::frameset::get_infrared_frame(unsigned long) const::{lambda(rs2::frame const&)#1}>(rs2::frameset::get_infrared_frame(unsigned long) const::{lambda(rs2::frame const&)#1}) const':

      rs-capture.cpp:(.text._ZNK3rs28frameset7foreachIZNKS0_18get_infrared_frameEmEUlRKNS_5frameEE_EEvT_[_ZNK3rs28frameset7foreachIZNKS0_18get_infrared_frameEmEUlRKNS_5frameEE_EEvT_]+0x7d): undefined reference to `rs2_extract_frame'

      CMakeFiles/rs-capture.dir/rs-capture.cpp.o: In function `std::enable_if<std::is_base_of<rs2::frame, rs2::frame>::value, bool>::type rs2::frame_queue::poll_for_frame<rs2::frame>(rs2::frame*) const':

      rs-capture.cpp:(.text._ZNK3rs211frame_queue14poll_for_frameINS_5frameEEENSt9enable_ifIXsrSt10is_base_ofIS2_T_E5valueEbE4typeEPS5_[_ZNK3rs211frame_queue14poll_for_frameINS_5frameEEENSt9enable_ifIXsrSt10is_base_ofIS2_T_E5valueEbE4typeEPS5_]+0x4e): undefined reference to `rs2_poll_for_frame'

      CMakeFiles/rs-capture.dir/rs-capture.cpp.o: In function `void rs2::processing_block::start<rs2::frame_queue>(rs2::frame_queue)':

      rs-capture.cpp:(.text._ZN3rs216processing_block5startINS_11frame_queueEEEvT_[_ZN3rs216processing_block5startINS_11frame_queueEEEvT_]+0x81): undefined reference to `rs2_start_processing'

      collect2: error: ld returned 1 exit status

      CMakeFiles/rs-capture.dir/build.make:94: recipe for target 'rs-capture' failed

      make[2]: *** [rs-capture] Error 1

      CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/rs-capture.dir/all' failed

      make[1]: *** [CMakeFiles/rs-capture.dir/all] Error 2

      Makefile:127: recipe for target 'all' failed

      make: *** [all] Error 2

       

      After that I checked that I had correctly installing OpenGL, finding  :

      OpenGL version string: 3.0 Mesa 18.0.5

       

      Finally, I would like to know what is missing in the procedure described above in order to correctly build from source.My knowledge of cmake is limited and I think the error must be related to that but I have not been able to find it.

      I would appreciate references to any documentation where it is explained how to properly build from source.

       

      THanks.

        • 1. Re: Building examples (capture) realsense D435
          Intel Corporation
          This message was posted on behalf of Intel Corporation

          Hi, 

          It looks like you've made the build directory in the wrong directory altogether and that's why you're getting these errors. 
          The Librealsense installation instructions say to create a build directory in the librealsense root directory, not in examples/capture.

          • navigate to the Librealsense root directory 
          • mkdir build
          • cd build
          • cmake .. -DBUILD_EXAMPLES=true
          Please let me know if you're able to run the examples after following these instructions!

          Regards,
          Sahira