‘p’ does not name a type
Hello,
I just installed Intel® RealSense™ SDK 2.0 for my ubuntu machine. I can see everything is working with "realsense-viewer" command.
I want to start with C++ examples provided and I am confused how to manage that. I copied the content of "rs-hello-realsense" into a .cpp file in my machine, but after running, I am facing this error " ‘p’ does not name a type" which I believe is related to initial lines of codes. I appreciate any help. I am using this code here: https://dev.intelrealsense.com/docs/rs-hello-realsense
-
Hi Reza Abiri
The link below contains guidance shared by a RealSense user about building rs-hello-realsense on Linux.
https://github.com/IntelRealSense/librealsense/issues/6797
This advice is similar to guidance provided for building the rs-capture example.
https://github.com/IntelRealSense/librealsense/issues/750#issuecomment-340266755
The approach taken by the SDK with building examples is to build a set of them together with the CMake flag -DBUILD_EXAMPLES=true instead of having the RealSense user build them individually. The built examples can then be launched.
If the code of a particular example is modified then building again should only build what has been changed.
https://github.com/IntelRealSense/librealsense/issues/2946#issuecomment-449290237
I would also recommend using the examples archive on the librealsense GitHub, as it provides the full project files for the example programs.
https://github.com/IntelRealSense/librealsense/tree/master/examples
-
Hello MartyG,
Thank you for your post and help. I have similar OS to this user. But, I am facing an error on building the project. please see following after running these lines in Ubuntu 18. Not sure what is wrong. Just to clarify I used this installation method: https://github.com/IntelRealSense/librealsense/blob/master/doc/distribution_linux.md
cd librealsense-master mkdir build && cd build cmake ../ -DBUILD_EXAMPLES=true sudo make uninstall && make clean && make && sudo make install/librealsense-master/build/third-party/libusb/libusb/core.c:23:10: fatal error: config.h: No such file or directory
#include "config.h"Thank you for your help!
-
Thank you very much for your help! I installed that. After that, actually it worked by resolving another issue related to GL:
https://github.com/IntelRealSense/librealsense/issues/5232
Right now, the rs-hello-realsense example is working. Overall, I feel simple installation of SDK from this page (https://github.com/IntelRealSense/librealsense/blob/master/doc/distribution_linux.md) does not help to run the example codes. I think these errors could be resolved automatically if I installed from source (?) (https://github.com/IntelRealSense/librealsense/blob/master/doc/installation.md).
-
If you installed the librealsense2-utils package using the instruction sudo apt-get install librealsense2-utils in the distribution_linux.md installation instructions then it should have installed the demos and tools. If you are able to launch rs-hello-realsense then I would expect this demo and tool installation to have been successful.
A list of example programs can be found in the link below.
https://github.com/IntelRealSense/librealsense/tree/master/examples
Please try launching some of the examples by adding rs- onto the front of the example names listed in the link above and inputting the name into the Ubuntu terminal (rs-capture for capture, rs-multicam for multicam, rs-sensor-control for sensor-control, etc).
You can look in the folder usr/local/bin/ to check whether the built examples are there.
The link below also provides a useful list of example filenames in the bin folder.
https://github.com/IntelRealSense/librealsense/issues/6568#issuecomment-644355010
Please sign in to leave a comment.
Comments
5 comments