-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Erro in building #2
Comments
Thanks for using the project. |
I'm sorry, I missed that I was fiddling with RealSense. In <librealsense-dir>/examples/example.hpp, change the set_viewport function to static, like so:
And delete the following functions from the file:
|
Hi, I used the static void set_viewport(const rect& r) function (example.hpp). draw_pointcloud As a result of these changes, I encountered fewer multiple definition errors. To resolve these errors, I removed the conflicting definitions from the code, and that solved the problem. Thank you so much for your help. |
Hi.
I've tried to build the code. But I got this error. I wonder if you have any guidance on how can solve this issue.
My Ubuntu version is 20.04.
Thanks
Error:
[ 45%] Building CXX object CMakeFiles/detect-stairs.dir/stairs.cpp.o
[ 50%] Building CXX object CMakeFiles/detect-stairs.dir/transformation.cpp.o
[ 54%] Building CXX object CMakeFiles/detect-stairs.dir/window.cpp.o
[ 59%] Linking CXX executable detect-stairs
/usr/bin/ld: CMakeFiles/detect-stairs.dir/geometricCalibration.cpp.o: in function
device_with_streams(std::vector<rs2_stream, std::allocator<rs2_stream> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&)': geometricCalibration.cpp:(.text+0x4fe): multiple definition of
device_with_streams(std::vector<rs2_stream, std::allocator<rs2_stream> >, std::__cxx11::basic_string<char, std::char_traits, std::allocator >&)'; CMakeFiles/detect-stairs.dir/detect-stairs.cpp.o:detect-stairs.cpp:(.text+0x4fe): first defined here/usr/bin/ld: CMakeFiles/detect-stairs.dir/geometricCalibration.cpp.o: in function
set_viewport(rect const&)': geometricCalibration.cpp:(.text+0xd86): multiple definition of
set_viewport(rect const&)'; CMakeFiles/detect-stairs.dir/detect-stairs.cpp.o:detect-stairs.cpp:(.text+0xd86): first defined here/usr/bin/ld: CMakeFiles/detect-stairs.dir/geometricCalibration.cpp.o: in function
draw_pointcloud(float, float, glfw_state&, rs2::points&)': geometricCalibration.cpp:(.text+0xe35): multiple definition of
draw_pointcloud(float, float, glfw_state&, rs2::points&)'; CMakeFiles/detect-stairs.dir/detect-stairs.cpp.o:detect-stairs.cpp:(.text+0xe35): first defined here/usr/bin/ld: CMakeFiles/detect-stairs.dir/geometricCalibration.cpp.o: in function
quat2mat(rs2_quaternion&, float*)': geometricCalibration.cpp:(.text+0x11dd): multiple definition of
quat2mat(rs2_quaternion&, float*)'; CMakeFiles/detect-stairs.dir/detect-stairs.cpp.o:detect-stairs.cpp:(.text+0x11dd): first defined here/usr/bin/ld: CMakeFiles/detect-stairs.dir/geometricCalibration.cpp.o: in function
draw_pointcloud_wrt_world(float, float, glfw_state&, rs2::points&, rs2_pose&, float*, std::vector<rs2_vector, std::allocator<rs2_vector> >&)': geometricCalibration.cpp:(.text+0x1538): multiple definition of
draw_pointcloud_wrt_world(float, float, glfw_state&, rs2::points&, rs2_pose&, float*, std::vector<rs2_vector, std::allocator<rs2_vector> >&)'; CMakeFiles/detect-stairs.dir/detect-stairs.cpp.o:detect-stairs.cpp:(.text+0x1538): first defined here/usr/bin/ld: CMakeFiles/detect-stairs.dir/geometricCalibration.cpp.o: in function
register_glfw_callbacks(window&, glfw_state&)': geometricCalibration.cpp:(.text+0x1ceb): multiple definition of
register_glfw_callbacks(window&, glfw_state&)'; CMakeFiles/detect-stairs.dir/detect-stairs.cpp.o:detect-stairs.cpp:(.text+0x1ceb): first defined here/usr/bin/ld: CMakeFiles/detect-stairs.dir/geometricCalibration.cpp.o: in function
get_screen_resolution(unsigned int&, unsigned int&)': geometricCalibration.cpp:(.text+0x1d9d): multiple definition of
get_screen_resolution(unsigned int&, unsigned int&)'; CMakeFiles/detect-stairs.dir/detect-stairs.cpp.o:detect-stairs.cpp:(.text+0x1d9d): first defined here/usr/bin/ld: CMakeFiles/detect-stairs.dir/pointcloud.cpp.o: in function
device_with_streams(std::vector<rs2_stream, std::allocator<rs2_stream> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&)': pointcloud.cpp:(.text+0x4fe): multiple definition of
device_with_streams(std::vector<rs2_stream, std::allocator<rs2_stream> >, std::__cxx11::basic_string<char, std::char_traits, std::allocator >&)'; CMakeFiles/detect-stairs.dir/detect-stairs.cpp.o:detect-stairs.cpp:(.text+0x4fe): first defined here/usr/bin/ld: CMakeFiles/detect-stairs.dir/pointcloud.cpp.o: in function
set_viewport(rect const&)': pointcloud.cpp:(.text+0xd86): multiple definition of
set_viewport(rect const&)'; CMakeFiles/detect-stairs.dir/detect-stairs.cpp.o:detect-stairs.cpp:(.text+0xd86): first defined here/usr/bin/ld: CMakeFiles/detect-stairs.dir/pointcloud.cpp.o: in function
draw_pointcloud(float, float, glfw_state&, rs2::points&)': pointcloud.cpp:(.text+0xe35): multiple definition of
draw_pointcloud(float, float, glfw_state&, rs2::points&)'; CMakeFiles/detect-stairs.dir/detect-stairs.cpp.o:detect-stairs.cpp:(.text+0xe35): first defined here/usr/bin/ld: CMakeFiles/detect-stairs.dir/pointcloud.cpp.o: in function
quat2mat(rs2_quaternion&, float*)': pointcloud.cpp:(.text+0x11dd): multiple definition of
quat2mat(rs2_quaternion&, float*)'; CMakeFiles/detect-stairs.dir/detect-stairs.cpp.o:detect-stairs.cpp:(.text+0x11dd): first defined here/usr/bin/ld: CMakeFiles/detect-stairs.dir/pointcloud.cpp.o: in function
draw_pointcloud_wrt_world(float, float, glfw_state&, rs2::points&, rs2_pose&, float*, std::vector<rs2_vector, std::allocator<rs2_vector> >&)': pointcloud.cpp:(.text+0x1538): multiple definition of
draw_pointcloud_wrt_world(float, float, glfw_state&, rs2::points&, rs2_pose&, float*, std::vector<rs2_vector, std::allocator<rs2_vector> >&)'; CMakeFiles/detect-stairs.dir/detect-stairs.cpp.o:detect-stairs.cpp:(.text+0x1538): first defined here/usr/bin/ld: CMakeFiles/detect-stairs.dir/pointcloud.cpp.o: in function
register_glfw_callbacks(window&, glfw_state&)': pointcloud.cpp:(.text+0x1ceb): multiple definition of
register_glfw_callbacks(window&, glfw_state&)'; CMakeFiles/detect-stairs.dir/detect-stairs.cpp.o:detect-stairs.cpp:(.text+0x1ceb): first defined here/usr/bin/ld: CMakeFiles/detect-stairs.dir/pointcloud.cpp.o: in function
get_screen_resolution(unsigned int&, unsigned int&)': pointcloud.cpp:(.text+0x1d9d): multiple definition of
get_screen_resolution(unsigned int&, unsigned int&)'; CMakeFiles/detect-stairs.dir/detect-stairs.cpp.o:detect-stairs.cpp:(.text+0x1d9d): first defined here/usr/bin/ld: CMakeFiles/detect-stairs.dir/window.cpp.o: in function
device_with_streams(std::vector<rs2_stream, std::allocator<rs2_stream> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&)': window.cpp:(.text+0x4fe): multiple definition of
device_with_streams(std::vector<rs2_stream, std::allocator<rs2_stream> >, std::__cxx11::basic_string<char, std::char_traits, std::allocator >&)'; CMakeFiles/detect-stairs.dir/detect-stairs.cpp.o:detect-stairs.cpp:(.text+0x4fe): first defined here/usr/bin/ld: CMakeFiles/detect-stairs.dir/window.cpp.o: in function
set_viewport(rect const&)': window.cpp:(.text+0xd86): multiple definition of
set_viewport(rect const&)'; CMakeFiles/detect-stairs.dir/detect-stairs.cpp.o:detect-stairs.cpp:(.text+0xd86): first defined here/usr/bin/ld: CMakeFiles/detect-stairs.dir/window.cpp.o: in function
draw_pointcloud(float, float, glfw_state&, rs2::points&)': window.cpp:(.text+0xe35): multiple definition of
draw_pointcloud(float, float, glfw_state&, rs2::points&)'; CMakeFiles/detect-stairs.dir/detect-stairs.cpp.o:detect-stairs.cpp:(.text+0xe35): first defined here/usr/bin/ld: CMakeFiles/detect-stairs.dir/window.cpp.o: in function
quat2mat(rs2_quaternion&, float*)': window.cpp:(.text+0x11dd): multiple definition of
quat2mat(rs2_quaternion&, float*)'; CMakeFiles/detect-stairs.dir/detect-stairs.cpp.o:detect-stairs.cpp:(.text+0x11dd): first defined here/usr/bin/ld: CMakeFiles/detect-stairs.dir/window.cpp.o: in function
draw_pointcloud_wrt_world(float, float, glfw_state&, rs2::points&, rs2_pose&, float*, std::vector<rs2_vector, std::allocator<rs2_vector> >&)': window.cpp:(.text+0x1538): multiple definition of
draw_pointcloud_wrt_world(float, float, glfw_state&, rs2::points&, rs2_pose&, float*, std::vector<rs2_vector, std::allocator<rs2_vector> >&)'; CMakeFiles/detect-stairs.dir/detect-stairs.cpp.o:detect-stairs.cpp:(.text+0x1538): first defined here/usr/bin/ld: CMakeFiles/detect-stairs.dir/window.cpp.o: in function
register_glfw_callbacks(window&, glfw_state&)': window.cpp:(.text+0x1ceb): multiple definition of
register_glfw_callbacks(window&, glfw_state&)'; CMakeFiles/detect-stairs.dir/detect-stairs.cpp.o:detect-stairs.cpp:(.text+0x1ceb): first defined here/usr/bin/ld: CMakeFiles/detect-stairs.dir/window.cpp.o: in function
get_screen_resolution(unsigned int&, unsigned int&)': window.cpp:(.text+0x1d9d): multiple definition of
get_screen_resolution(unsigned int&, unsigned int&)'; CMakeFiles/detect-stairs.dir/detect-stairs.cpp.o:detect-stairs.cpp:(.text+0x1d9d): first defined here/usr/bin/ld: CMakeFiles/detect-stairs.dir/detect-stairs.cpp.o: in function
draw_pointcloud(float, float, glfw_state&, rs2::points&)': detect-stairs.cpp:(.text+0xf00): undefined reference to
gluPerspective'/usr/bin/ld: detect-stairs.cpp:(.text+0xf5e): undefined reference to
gluLookAt' /usr/bin/ld: CMakeFiles/detect-stairs.dir/detect-stairs.cpp.o: in function
draw_pointcloud_wrt_world(float, float, glfw_state&, rs2::points&, rs2_pose&, float*, std::vector<rs2_vector, std::allocator<rs2_vector> >&)':detect-stairs.cpp:(.text+0x1630): undefined reference to
gluPerspective' /usr/bin/ld: CMakeFiles/detect-stairs.dir/geometricCalibration.cpp.o: in function
draw_pointcloud(float, float, glfw_state&, rs2::points&)':geometricCalibration.cpp:(.text+0xf00): undefined reference to
gluPerspective' /usr/bin/ld: geometricCalibration.cpp:(.text+0xf5e): undefined reference to
gluLookAt'/usr/bin/ld: CMakeFiles/detect-stairs.dir/geometricCalibration.cpp.o: in function
draw_pointcloud_wrt_world(float, float, glfw_state&, rs2::points&, rs2_pose&, float*, std::vector<rs2_vector, std::allocator<rs2_vector> >&)': geometricCalibration.cpp:(.text+0x1630): undefined reference to
gluPerspective'/usr/bin/ld: CMakeFiles/detect-stairs.dir/pointcloud.cpp.o: in function
draw_pointcloud(float, float, glfw_state&, rs2::points&)': pointcloud.cpp:(.text+0xf00): undefined reference to
gluPerspective'/usr/bin/ld: pointcloud.cpp:(.text+0xf5e): undefined reference to
gluLookAt' /usr/bin/ld: CMakeFiles/detect-stairs.dir/pointcloud.cpp.o: in function
draw_pointcloud_wrt_world(float, float, glfw_state&, rs2::points&, rs2_pose&, float*, std::vector<rs2_vector, std::allocator<rs2_vector> >&)':pointcloud.cpp:(.text+0x1630): undefined reference to
gluPerspective' /usr/bin/ld: CMakeFiles/detect-stairs.dir/window.cpp.o: in function
draw_pointcloud(float, float, glfw_state&, rs2::points&)':window.cpp:(.text+0xf00): undefined reference to
gluPerspective' /usr/bin/ld: window.cpp:(.text+0xf5e): undefined reference to
gluLookAt'/usr/bin/ld: CMakeFiles/detect-stairs.dir/window.cpp.o: in function
draw_pointcloud_wrt_world(float, float, glfw_state&, rs2::points&, rs2_pose&, float*, std::vector<rs2_vector, std::allocator<rs2_vector> >&)': window.cpp:(.text+0x1630): undefined reference to
gluPerspective'collect2: error: ld returned 1 exit status
gmake[2]: *** [CMakeFiles/detect-stairs.dir/build.make:273: detect-stairs] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:85: CMakeFiles/detect-stairs.dir/all] Error 2
gmake: *** [Makefile:91: all] Error 2
The text was updated successfully, but these errors were encountered: