Ask Your Question
0

Compilation errors with ROS Melodic on Ubuntu 18.04 and gcc-10

asked 2020-05-17 00:28:38 -0500

pauljurczak gravatar image

updated 2020-05-17 00:41:00 -0500

I have roscppproject using ROS Melodic on Ubuntu 18.04. It builds fine with gcc-9.3.0, but when I switch compiler version to gcc-10.0.1, compilation fails with following error:

[build] /opt/ros/melodic/include/std_msgs/Header.h:46:121: error: no class template named ‘rebind’ in ‘class std::allocator<void>’

In both cases I'm using C++20 standard:

set_property(TARGET af PROPERTY CXX_STANDARD 20)

Is it possible to use gcc-10 in my environment?

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2021-02-28 07:33:03 -0500

jsuero gravatar image

did you add the C++-10 libraries?

sudo apt install gcc-10 gcc-10-base gcc-10-doc sudo apt install libstdc++-10-dev libstdc++-10-doc

when i run g++10 on ubunto 2094 focal with -v it looks like it looks for stuff here in these directories which are all having the number 10 in the path

/usr/include/c++/10 /usr/include/x86_64-linux-gnu/c++/10 /usr/include/c++/10/backward /usr/lib/gcc/x86_64-linux-gnu/10/include /usr/local/include /usr/include/x86_64-linux-gnu /usr/include

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2020-05-17 00:28:38 -0500

Seen: 213 times

Last updated: May 17 '20