VSCode use
What do I need to do to be able to use Visual Studio Code for debugging and intellisense on examples in the SDK? Running Ubuntu 18.04, SDK 2.43. I get errors below trying to debug rs-distance
Executing task: C/C++: gcc-7 build active file <
Starting build...
/usr/bin/gcc-7 -g /home/kirk/librealsense-2.43.0/examples/C/distance/rs-distance.c -o /home/kirk/librealsense-2.43.0/examples/C/distance/rs-distance
/tmp/ccS9jfVO.o: In function `check_error':
/home/kirk/librealsense-2.43.0/examples/C/distance/../example.h:13: undefined reference to `rs2_get_failed_args'
/home/kirk/librealsense-2.43.0/examples/C/distance/../example.h:13: undefined reference to `rs2_get_failed_function'
/home/kirk/librealsense-2.43.0/examples/C/distance/../example.h:14: undefined reference to `rs2_get_error_message'
/tmp/ccS9jfVO.o: In function `print_device_info':
/home/kirk/librealsense-2.43.0/examples/C/distance/../example.h:22: undefined reference to `rs2_get_device_info'
/home/kirk/librealsense-2.43.0/examples/C/distance/../example.h:24: undefined reference to `rs2_get_device_info'
/home/kirk/librealsense-2.43.0/examples/C/distance/../example.h:26: undefined reference to `rs2_get_device_info'
/tmp/ccS9jfVO.o: In function `main':
/home/kirk/librealsense-2.43.0/examples/C/distance/rs-distance.c:34: undefined reference to `rs2_create_context'
/home/kirk/librealsense-2.43.0/examples/C/distance/rs-distance.c:39: undefined reference to `rs2_query_devices'
/home/kirk/librealsense-2.43.0/examples/C/distance/rs-distance.c:42: undefined reference to `rs2_get_device_count'
/home/kirk/librealsense-2.43.0/examples/C/distance/rs-distance.c:50: undefined reference to `rs2_create_device'
/home/kirk/librealsense-2.43.0/examples/C/distance/rs-distance.c:57: undefined reference to `rs2_create_pipeline'
/home/kirk/librealsense-2.43.0/examples/C/distance/rs-distance.c:62: undefined reference to `rs2_create_config'
/home/kirk/librealsense-2.43.0/examples/C/distance/rs-distance.c:66: undefined reference to `rs2_config_enable_stream'
/home/kirk/librealsense-2.43.0/examples/C/distance/rs-distance.c:71: undefined reference to `rs2_pipeline_start_with_config'
/home/kirk/librealsense-2.43.0/examples/C/distance/rs-distance.c:83: undefined reference to `rs2_pipeline_wait_for_frames'
/home/kirk/librealsense-2.43.0/examples/C/distance/rs-distance.c:87: undefined reference to `rs2_embedded_frames_count'
/home/kirk/librealsense-2.43.0/examples/C/distance/rs-distance.c:94: undefined reference to `rs2_extract_frame'
/home/kirk/librealsense-2.43.0/examples/C/distance/rs-distance.c:99: undefined reference to `rs2_is_frame_extendable_to'
/home/kirk/librealsense-2.43.0/examples/C/distance/rs-distance.c:103: undefined reference to `rs2_get_frame_width'
/home/kirk/librealsense-2.43.0/examples/C/distance/rs-distance.c:105: undefined reference to `rs2_get_frame_height'
/home/kirk/librealsense-2.43.0/examples/C/distance/rs-distance.c:109: undefined reference to `rs2_depth_frame_get_distance'
/home/kirk/librealsense-2.43.0/examples/C/distance/rs-distance.c:115: undefined reference to `rs2_release_frame'
/home/kirk/librealsense-2.43.0/examples/C/distance/rs-distance.c:118: undefined reference to `rs2_release_frame'
collect2: error: ld returned 1 exit status
Build finished with error(s).
The terminal process failed to launch (exit code: -1).
Terminal will be reused by tasks, press any key to close it.
-
Hello Kirkpennock. May you provide more details on how to run in Visual Studio Code since the problem for me is that when I run with the bar you mentioned with rs-hello-realsense.cpp, I get the error message saying "librealsense2/rs.hpp: No such file or directory". Now It works normally when I run it on visual studio 2022.
Please sign in to leave a comment.
Comments
2 comments