Closed GuidoBartoli closed 6 years ago
Hi @GuidoBartoli ,
These look like regular linkage issues, telling you that the linker can't find the implementation of these functions (rs2_*
). It looks like you forgot to tell CMake
to link the realsense2
library.
Please make sure that you properly installed librealsense, make sure that /usr/lib
or /usr/local/lib
has realsense2.so
. You might want to try to run ldconfig
to tell the linker to refresh itself.
On another note- we provide a ROS wrapper, you might want to have a look at it.
Wow, what a blunder from me... I forgot to link the node to library!
add_executable(
realsense_driver
src/RealSenseDriverNode.cpp
)
add_dependencies(realsense_driver ${catkin_EXPORTED_TARGETS})
target_link_libraries(
realsense_driver
realsense2
${catkin_LIBRARIES}
)
Thanks for pointing it out! :)
I will take a look to the ROS wrapper, I did not know it existed.
@GuidoBartoli Hello, i have the same error in Eclipse. I've binded all libraries. But still has it problem. Did you update your Makefile?
@dmitryshendryk Yes, I edited the CMakeLists.txt
file as I reported in my last post. The node executable was missing the linking to the realsense2 library.
@zivsha I wrote a simple cpp file to check the working of librealsense2.
int main(int argc, char * argv[]){ window app(1280, 960, "CPP MUlti-Camera Example"); rs2::context ctx; return 0; }
I keep getting the undefined reference error for rs2. I run the following command g++ to_check_librealsense2.cpp -lGL -lGLU -lglut where the linkers -lGL, -lGLU and -lglut are for openGL. Before adding these linkers I was getting undefined reference for even openGL functions. Is there a similar linker function for rs2. Thanks!
I'm writing a ROS node for embedding Intel RealSense D435 perception into a robotics project. I installed the SDK 2 following the official guide (I encountered some problems with
sudo apt-key adv --keyserver keys.gnupg.net --recv-key 6F3EFCDE
because GPG key could not be retrieved, but I managed to manually download it and add to keyring).Aside from some glitches (some warning and error popups), RealSense Viewer is working properly now.
After that, I wrote a very simple C++ test node to try fetching frames following the "rs-capture.cpp" example provided (I already updated my
CMakeLists.txt
to correctly compile this node):After issuing the usual
catkin_make
command I received many error messages (I don't report them here for brevity), so I reduced the body to justrs2::pipeline pipe;
to better identify the problem and that's what I receive:It seems a problem inside the SDK, but I really cannot understand why it cannot find its own structures and types... does anyone knows what I'm missing here?
Thanks, Best regards