error in colcon build of is-core ("numeric_limits" and "max")
FlorianPix opened this issue · 15 comments
OS: Ubuntu 22.04.1
When I try to install the is-core following the instructions and use colcon build I get these errors:
error: ‘numeric_limits’ is not a member of ‘std’
error: ‘::max’ has not been declared; did you mean ‘std::max’?
To me that seems like #include <limits.h>
is missing but I guess that can't be the case because then everyone would have this issue.
What else could be the reason ?
Should I try an older ubuntu or ROS version ?
Currently I'm using Ubuntu 22.04.1 and ROS2 humble.
It works with Ubuntu 20.04 and ROS2 foxy.
The 'issue' is the newer version of gcc because it looks like it's more strict?.
hi @russkel thanks a lot for your input, I have followed your instructions but after that I am getting a new error. I have build it succesfully with ros2 foxy on Ubuntu 20.04.
/app/is_workspace/src/FastDDS-SH/src/Participant.cpp: In member function ‘const eprosima::fastrtps::types::DynamicType* eprosima::is::sh::fastdds::Participant::get_dynamic_type(const string&) const’:
/app/is_workspace/src/FastDDS-SH/src/Participant.cpp:278:30: error: ISO C++ forbids declaration of ‘type name’ with no type [-fpermissive]
278 | return static_cast<const DynamicType*>(it->second.GetDynamicType().get());
| ^~~~~~~~~~~
/app/is_workspace/src/FastDDS-SH/src/Participant.cpp:278:30: error: expected ‘>’ before ‘DynamicType’
/app/is_workspace/src/FastDDS-SH/src/Participant.cpp:278:30: error: expected ‘(’ before ‘DynamicType’
278 | return static_cast<const DynamicType*>(it->second.GetDynamicType().get());
| ^~~~~~~~~~~
| (
/app/is_workspace/src/FastDDS-SH/src/Participant.cpp:278:30: error: reference to ‘DynamicType’ is ambiguous
278 | return static_cast<const DynamicType*>(it->second.GetDynamicType().get());
| ^~~~~~~~~~~
In file included from /app/is_workspace/src/FastDDS-SH/src/Participant.hpp:26,
from /app/is_workspace/src/FastDDS-SH/src/Participant.cpp:18:
/opt/ros/humble/include/fastrtps/fastrtps/types/DynamicType.h:37:7: note: candidates are: ‘class eprosima::fastrtps::types::DynamicType’
37 | class DynamicType
| ^~~~~~~~~~~
In file included from /opt/ros/humble/include/fastrtps/fastdds/dds/topic/IContentFilter.hpp:31,
from /opt/ros/humble/include/fastrtps/fastdds/dds/topic/IContentFilterFactory.hpp:25,
from /opt/ros/humble/include/fastrtps/fastdds/dds/domain/DomainParticipant.hpp:34,
from /app/is_workspace/src/FastDDS-SH/src/Participant.hpp:23,
from /app/is_workspace/src/FastDDS-SH/src/Participant.cpp:18:
/opt/ros/humble/include/fastrtps/fastrtps/types/TypeDescriptor.h:23:7: note: ‘class DynamicType’
23 | class DynamicType;
| ^~~~~~~~~~~
/app/is_workspace/src/FastDDS-SH/src/Participant.cpp:278:42: error: expected primary-expression before ‘>’ token
278 | return static_cast<const DynamicType*>(it->second.GetDynamicType().get());
| ^
/app/is_workspace/src/FastDDS-SH/src/Participant.cpp:278:78: error: expected ‘)’ before ‘;’ token
278 | return static_cast<const DynamicType*>(it->second.GetDynamicType().get());
| ^
| )
gmake[2]: *** [CMakeFiles/is-fastdds.dir/build.make:146: CMakeFiles/is-fastdds.dir/src/Participant.cpp.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
gmake[1]: *** [CMakeFiles/Makefile2:111: CMakeFiles/is-fastdds.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2
---
Failed <<< is-fastdds [35.8s, exited with code 2]
Aborted <<< is-ros2 [44.8s]
Summary: 5 packages finished [1min 50s]
1 package failed: is-fastdds
1 package aborted: is-ros2
7 packages had stderr output: is-core is-examples is-fastdds is-json-xtypes is-mock is-ros2 xtypes
1 package not processed
Any suggestions?
That's a different SH I haven't used.
Is eprosima::fastrtps::types
namespaced in the file? I haven't used this one and don't have time to chase down the issue at the moment.
Hi @russkel thanks a lot for your reply.
I am using Integration-service, FastDDS-SH and ROS2-SH. For integration-service I am using the main branch. I have cloned your xtypes and replaced it in the thridparty folder of Xtypes.
Is eprosima::fastrtps::types namespaced in the file?
I have no idea what you are talking about.
Can you please suggest a working versions of Integration-service and respective SH?
Hi @sumitpaulde,
I am getting the same build error. Did you find a solution?
I just followed installation steps given in docs - https://integration-service.docs.eprosima.com/en/latest/installation_manual/installation.html
@sumitpaulde I will have a look at this in the coming days as I have to do some work on related libraries.
Hi @sumitpaulde,
I am getting the same build error. Did you find a solution? I just followed installation steps given in docs - https://integration-service.docs.eprosima.com/en/latest/installation_manual/installation.html
@h1r4n Not yet will let you know if I can solve it.
@russkel thanks a lot. Waiting for you!
Hi @sumitpaulde,
I am getting the same build error. Did you find a solution? I just followed installation steps given in docs - https://integration-service.docs.eprosima.com/en/latest/installation_manual/installation.html@h1r4n Not yet will let you know if I can solve it. @russkel thanks a lot. Waiting for you!
It looks like this has already been fixed in a PR: eProsima/FastDDS-SH#87
I disagree; I do not believe they are related.
OS: Ubuntu 22.04
g++: 11.3.0
My first error:
/home/ryan/Documents/is_ws/install/xtypes/include/xtypes/UnionType.hpp:45:17: error: ‘numeric_limits’ is not a member of ‘std’
45 | return std::numeric_limits<int64_t>::max() >> ((sizeof(int64_t) - type_size) * 8);
numeric_limits
is indeed a member of std
, but it's defined in <limits>
. This is a missing include in the xtypes library, not Integration-Service.
The diff looks like so:
ryan@ryan-m93p:~/Documents/is_ws/src/src/Integration-Service/thirdparty/xtypes$ git diff
diff --git a/include/xtypes/UnionType.hpp b/include/xtypes/UnionType.hpp
index bb4e239..7671165 100644
--- a/include/xtypes/UnionType.hpp
+++ b/include/xtypes/UnionType.hpp
@@ -22,6 +22,7 @@
#include <xtypes/AliasType.hpp>
#include <xtypes/EnumerationType.hpp>
+#include <limits>
#include <string>
#include <map>
#include <vector>
The PR that fixes that is here:
eProsima/xtypes#108
Sweet. The EProsima team has merged the xtypes PR. I'll issue a PR here to update the submodule hash in just a bit.
I updated the submodule to latest, but now get a bunch of build errors. Compiling Integration Service in Ubuntu 22.04 is blocked for unrelated errors. Since this appears to be fixed in eProsima/xtypes#113, I'm not going to issue a PR here.
I have the same problem.
A workaround is to open thirdparty/xtypes/include/xtypes/UnionType.hpp and add
#include <limits>
to it with the currently referenced submodule "xtypes @ 29e7c3a".
#186 introduced an updated version of xtypes that solves this issue.