Compile error with ROS. Possible bug?
Hello! I have been trying to compile my project with ROS Indigo and C++ (Ubuntu 14.04) and getting an error which I do not understand. I define a class named Point2dc and in the code, it is used multiple times to create vectors etc. The (4000 line) error I get can be found below under the link:
The class is defined as follows:
#ifndef POINT2DC_H
#define POINT2DC_H
#include "ros/ros.h"
#include <iostream>
#include <stdlib.h>
#include <math.h>
#include <vector>
#include <i2ease_msgs/VehicleObject.h>
#include <i2ease_msgs/Object.h>
#include <i2ease_msgs/VehicleObjectList.h>
#include <i2ease_msgs/SensorObjectList.h>
using namespace std;
using namespace ros;
class Point2dc
{
public:
Point2dc(float pos_x, float pos_y);
Point2dc();
float pos_x;
float pos_y;
float get_polar_angle();
float get_polar_r();
float distance_to_point(Point2dc p);
};
#endif
The error occurs, when including "ros/ros.h" in another custom class called Vehicle.
Thanks in advance.
Edit:
This is just a small excerpt of the error I get. For the full error, please check the link above. Excuse my poor formatting :)
from /usr/include/boost/math/tools/config.hpp:16,
from /usr/include/boost/math/special_functions/round.hpp:13,
from /opt/ros/indigo/include/ros/time.h:58,
from /opt/ros/indigo/include/ros/ros.h:38,
from /home/mertes13/catkin_ws/src/irt_visualization/include/Vehicle.h:4,
from /home/mertes13/catkin_ws/src/irt_visualization/src/Vehicle.cpp:1:
/usr/include/c++/4.8/bits/stl_algo.h:166:17: note: ‘Point2dc’ is not derived from ‘conststd::_List_iterator<_Tp>’
if (*__first == __val)
^
In file included from /usr/include/c++/4.8/set:62:0,
from /opt/ros/indigo/include/ros/forwards.h:34,
from /opt/ros/indigo/include/ros/common.h:37,
from /opt/ros/indigo/include/ros/ros.h:43,
from /home/mertes13/catkin_ws/src/irt_visualization/include/Vehicle.h:4,
from /home/mertes13/catkin_ws/src/irt_visualization/src/Vehicle.cpp:1:
/usr/include/c++/4.8/bits/stl_multiset.h:739:5: note: template<class _Key, class _Compare, class _Alloc> bool std::operator==(const std::multiset<_Key, _Compare, _Alloc>&, const std::multiset<_Key, _Compare, _Alloc>&)
operator==(const multiset<_Key, _Compare, _Alloc>& __x,
^
/usr/include/c++/4.8/bits/stl_multiset.h:739:5: note: template argument deduction/substitution failed:
In file included from /usr/include/c++/4.8/algorithm:62:0,
from /usr/include/boost/math/tools/config.hpp:16,
from /usr/include/boost/math/special_functions/round.hpp:13,
from /opt/ros/indigo/include/ros/time.h:58,
from /opt/ros/indigo/include/ros/ros.h:38,
from /home/mertes13/catkin_ws/src/irt_visualization/include/Vehicle.h:4,
from /home/mertes13/catkin_ws/src/irt_visualization/src/Vehicle.cpp:1:
/usr/include/c++/4.8/bits/stl_algo.h:166:17: note: ‘Point2dc’ is not derived from ‘const std::multiset<_Key, _Compare, _Alloc>’
if (*__first == __val)
^
In file included from /usr/include/c++/4.8/set:61:0,
from /opt/ros/indigo/include/ros/forwards.h:34,
from /opt/ros/indigo/include/ros/common.h:37,
from /opt/ros/indigo/include/ros/ros.h:43,
from /home/mertes13 ...
Please include the error message in your question. If the pastebin link ever goes away, this question becomes useless.
Thanks! I pasted just a small part of the error, since it is over 4000 lines. The rest is pretty similar to this. Hope this helps.