Skip to content
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

Ubuntu 18.04 and ROS Melodic compile error.Error: call of overloaded ‘round(float)’ is ambiguous #100

Open
a4zhangfei opened this issue Nov 10, 2018 · 4 comments

Comments

@a4zhangfei
Copy link

a4zhangfei commented Nov 10, 2018

error: ‘int round(float)’ conflicts with a previous declaration
inline int round(float d)
^
In file included from /opt/ros/melodic/include/ros/time.h:55:0,
from /opt/ros/melodic/include/ros/ros.h:38,
from /home/zhangzhihao/kinetic_rgbdslam_catkin_ws/src/kinetic_slam/src/misc.cpp:16:
/usr/include/c++/7/cmath:1771:3: note: previous declaration ‘constexpr float std::round(float)’
round(float __x)
^~~~~
/home/zhangzhihao/kinetic_rgbdslam_catkin_ws/src/kinetic_slam/src/misc.cpp: In function ‘void observationLikelihood(const Matrix4f&, pcl::PointCloudpcl::PointXYZRGB::Ptr, pcl::PointCloudpcl::PointXYZRGB::Ptr, const CameraInfo&, double&, double&, unsigned int&, unsigned int&, unsigned int&, unsigned int&)’:
/home/zhangzhihao/kinetic_rgbdslam_catkin_ws/src/kinetic_slam/src/misc.cpp:880:53: error: call of overloaded ‘round(float)’ is ambiguous
int old_rx_center = round((p.x / p.z)* fx + cx);
^
In file included from /usr/include/features.h:424:0,
from /usr/include/x86_64-linux-gnu/c++/7/bits/os_defines.h:39,
from /usr/include/x86_64-linux-gnu/c++/7/bits/c++config.h:533,
from /usr/include/c++/7/cstdlib:41,
from /usr/include/c++/7/stdlib.h:36,
from /opt/ros/melodic/include/ros/platform.h:53,
from /opt/ros/melodic/include/ros/time.h:53,
from /opt/ros/melodic/include/ros/ros.h:38,
from /home/zhangzhihao/kinetic_rgbdslam_catkin_ws/src/kinetic_slam/src/misc.cpp:16:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:298:1: note: candidate: double round(double)
__MATHCALLX (round,, (Mdouble __x), (const));
^
In file included from /opt/ros/melodic/include/ros/time.h:55:0,
from /opt/ros/melodic/include/ros/ros.h:38,
from /home/zhangzhihao/kinetic_rgbdslam_catkin_ws/src/kinetic_slam/src/misc.cpp:16:
/usr/include/c++/7/cmath:1771:3: note: candidate: constexpr float std::round(float)
round(float __x)
^~~~~
/usr/include/c++/7/cmath:1775:3: note: candidate: constexpr long double std::round(long double)
round(long double __x)
^~~~~
/home/zhangzhihao/kinetic_rgbdslam_catkin_ws/src/kinetic_slam/src/misc.cpp:804:12: note: candidate: int round(float)
inline int round(float d)
^~~~~
/home/zhangzhihao/kinetic_rgbdslam_catkin_ws/src/kinetic_slam/src/misc.cpp:881:53: error: call of overloaded ‘round(float)’ is ambiguous
int old_ry_center = round((p.y / p.z)* fy + cy);
^

@a4zhangfei a4zhangfei changed the title Ubuntu 18.04 and ROS Melodic. Ubuntu 18.04 and ROS Melodic compile error Nov 10, 2018
@a4zhangfei a4zhangfei changed the title Ubuntu 18.04 and ROS Melodic compile error Ubuntu 18.04 and ROS Melodic compile error.Error: call of overloaded ‘round(float)’ is ambiguous Nov 10, 2018
@Magical-E
Copy link

Hello,I meet the same error in Ubuntu 18.04 .Have you already solved it?

@a4zhangfei
Copy link
Author

a4zhangfei commented Jul 24, 2019 via email

@ideechaniz
Copy link

I have the same problem under debian 10 and ros melodic

@QianYC
Copy link

QianYC commented Dec 25, 2019

there is an inline function named "round" in misc.cpp, you can solve this problem by simply rename the function and the revoke to anything like "myround"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants