ros2 / rmw_iceoryx

rmw implementation for iceoryx
Apache License 2.0
144 stars 27 forks source link

Add include header <stdexcept> to fix build error #59

Closed homalozoa closed 2 years ago

homalozoa commented 2 years ago

\<stdexcept> is needed by std::runtime_error. Ref: std::runtime_error

Error

Starting >>> rmw_iceoryx_cpp --- stderr: rmw_iceoryx_cpp In file included from /home/homalozoa/temp/ice_test/src/rmw_iceoryx/rmw_iceoryx_cpp/src/internal/./iceoryx_serialize_typesupport_c.hpp:28, from /home/homalozoa/temp/ice_test/src/rmw_iceoryx/rmw_iceoryx_cpp/src/internal/iceoryx_serialize.cpp:31: /home/homalozoa/temp/ice_test/src/rmw_iceoryx/rmw_iceoryx_cpp/src/internal/././iceoryx_serialization_common.hpp: In function ‘std::pair<const char*, unsigned int> rmw_iceoryx_cpp::pop_sequence_size(const char*)’: /home/homalozoa/temp/ice_test/src/rmw_iceoryx/rmw_iceoryx_cpp/src/internal/././iceoryx_serialization_common.hpp:60:16: error: ‘runtime_error’ is not a member of ‘std’ 60 | throw std::runtime_error("can't load array size: check failed"); | ^~~~~~~~~~~~~ In file included from /home/homalozoa/temp/ice_test/src/rmw_iceoryx/rmw_iceoryx_cpp/src/internal/iceoryx_serialize.cpp:31: /home/homalozoa/temp/ice_test/src/rmw_iceoryx/rmw_iceoryx_cpp/src/internal/./iceoryx_serialize_typesupport_c.hpp: In function ‘void rmw_iceoryx_cpp::details_c::serialize(const void*, const rosidl_typesupport_introspection_c__MessageMembers*, std::vector<char>&)’: /home/homalozoa/temp/ice_test/src/rmw_iceoryx/rmw_iceoryx_cpp/src/internal/./iceoryx_serialize_typesupport_c.hpp:190:26: error: ‘runtime_error’ is not a member of ‘std’ 190 | throw std::runtime_error("vector overcomes the maximum length"); | ^~~~~~~~~~~~~ /home/homalozoa/temp/ice_test/src/rmw_iceoryx/rmw_iceoryx_cpp/src/internal/./iceoryx_serialize_typesupport_c.hpp:206:20: error: ‘runtime_error’ is not a member of ‘std’ 206 | throw std::runtime_error("unknown type"); | ^~~~~~~~~~~~~ make[2]: *** [CMakeFiles/rmw_iceoryx_serialization.dir/build.make:90: CMakeFiles/rmw_iceoryx_serialization.dir/src/internal/iceoryx_serialize.cpp.o] Error 1 make[1]: *** [CMakeFiles/Makefile2:229: CMakeFiles/rmw_iceoryx_serialization.dir/all] Error 2 make: *** [Makefile:146: all] Error 2

occured without adding it by using GCC 11.1 in Arch Linux.

Signed-off-by: Homalozoa xuhaiwang@xiaomi.com

ZhenshengLee commented 2 years ago

@homalozoa

Glad to see a Chinese developer here.

I am one of contributors of this repo.

Feel free to add me through WeChat of zhensheng_li so we can discuss more with ros2 development.

加我微信zhensheng_li 获取社区力量。

karthiknit1 commented 2 years ago

Hi,

Can this be backported to ros2 Foxy branch?

Thanks, Karthik Reddy

mossmaurice commented 2 years ago

Can this be backported to ros2 Foxy branch?

@karthiknit1 Sure, it would be much appreciated if you could create a PR for this.