Skip to content
This repository has been archived by the owner on Aug 5, 2024. It is now read-only.

Error 2 with make -j4 [Ubuntu 20.04, Gazebo 11.3] #47

Closed
ChrisMos1 opened this issue Feb 15, 2021 · 4 comments · Fixed by #50
Closed

Error 2 with make -j4 [Ubuntu 20.04, Gazebo 11.3] #47

ChrisMos1 opened this issue Feb 15, 2021 · 4 comments · Fixed by #50

Comments

@ChrisMos1
Copy link

When running make -j4, I get the following errors and warnings.

chris@Ubuntuchris:~/ardupilot_gazebo/build$ make -j4
[ 25%] Building CXX object CMakeFiles/ArduPilotPlugin.dir/src/ArduPilotPlugin.cc.o
[ 25%] Built target ArduCopterIRLockPlugin
/home/chris/ardupilot_gazebo/src/ArduPilotPlugin.cc: In instantiation of ‘void __gnu_cxx::new_allocator<_Tp>::construct(_Up*, _Args&& ...) [with _Up = Control; _Args = {const Control&}; _Tp = Control]’:
/usr/include/c++/9/bits/alloc_traits.h:484:4:   required from ‘static void std::allocator_traits<std::allocator<_CharT> >::construct(std::allocator_traits<std::allocator<_CharT> >::allocator_type&, _Up*, _Args&& ...) [with _Up = Control; _Args = {const Control&}; _Tp = Control; std::allocator_traits<std::allocator<_CharT> >::allocator_type = std::allocator<Control>]’
/usr/include/c++/9/bits/stl_vector.h:1189:30:   required from ‘void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = Control; _Alloc = std::allocator<Control>; std::vector<_Tp, _Alloc>::value_type = Control]’
/home/chris/ardupilot_gazebo/src/ArduPilotPlugin.cc:622:46:   required from here
/home/chris/ardupilot_gazebo/src/ArduPilotPlugin.cc:109:7: warning: implicitly-declared ‘constexpr gazebo::common::PID::PID(const gazebo::common::PID&)’ is deprecated [-Wdeprecated-copy]
  109 | class Control
      |       ^~~~~~~
In file included from /usr/include/gazebo-11/gazebo/physics/JointController.hh:25,
                 from /usr/include/gazebo-11/gazebo/physics/physics.hh:23,
                 from /usr/include/gazebo-11/gazebo/sensors/WirelessTransmitter.hh:22,
                 from /usr/include/gazebo-11/gazebo/sensors/sensors.hh:27,
                 from /home/chris/ardupilot_gazebo/src/ArduPilotPlugin.cc:46:
/usr/include/gazebo-11/gazebo/common/PID.hh:157:20: note: because ‘gazebo::common::PID’ has user-provided ‘gazebo::common::PID& gazebo::common::PID::operator=(const gazebo::common::PID&)’
  157 |       public: PID &operator=(const PID &_p)
      |                    ^~~~~~~~
In file included from /usr/include/x86_64-linux-gnu/c++/9/bits/c++allocator.h:33,
                 from /usr/include/c++/9/bits/allocator.h:46,
                 from /usr/include/c++/9/string:41,
                 from /usr/include/c++/9/stdexcept:39,
                 from /usr/include/c++/9/array:39,
                 from /usr/include/c++/9/tuple:39,
                 from /usr/include/c++/9/functional:54,
                 from /home/chris/ardupilot_gazebo/src/ArduPilotPlugin.cc:17:
/usr/include/c++/9/ext/new_allocator.h:147:4: note: synthesized method ‘Control::Control(const Control&)’ first required here
  147 |  { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); }
      |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/sdformat-9.5/sdf/Param.hh:30,
                 from /usr/include/sdformat-9.5/sdf/Element.hh:28,
                 from /usr/include/sdformat-9.5/sdf/Actor.hh:25,
                 from /usr/include/sdformat-9.5/sdf/sdf.hh:2,
                 from /home/chris/ardupilot_gazebo/src/ArduPilotPlugin.cc:41:
/usr/include/c++/9/variant: In instantiation of ‘constexpr std::add_pointer_t<_Tp> std::get_if(std::variant<_Types ...>*) [with _Tp = short unsigned int; _Types = {bool, char, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int, long unsigned int, unsigned int, double, float, sdf::v9::Time, ignition::math::v6::Angle, ignition::math::v6::Color, ignition::math::v6::Vector2<int>, ignition::math::v6::Vector2<double>, ignition::math::v6::Vector3<double>, ignition::math::v6::Quaternion<double>, ignition::math::v6::Pose3<double>}; std::add_pointer_t<_Tp> = short unsigned int*]’:
/usr/include/sdformat-9.5/sdf/Param.hh:318:34:   required from ‘bool sdf::v9::Param::Get(T&) const [with T = short unsigned int]’
/usr/include/sdformat-9.5/sdf/Element.hh:511:7:   required from ‘std::pair<T, bool> sdf::v9::Element::Get(const string&, const T&) const [with T = short unsigned int; std::string = std::__cxx11::basic_string<char>]’
/home/chris/ardupilot_gazebo/src/ArduPilotPlugin.cc:879:57:   required from here
/usr/include/c++/9/variant:1125:42: error: static assertion failed: T should occur for exactly once in alternatives
 1125 |       static_assert(__detail::__variant::__exactly_once<_Tp, _Types...>,
      |                     ~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/9/variant: In instantiation of ‘struct std::variant_alternative<1, std::variant<ignition::math::v6::Pose3<double> > >’:
/usr/include/c++/9/variant:100:12:   recursively required from ‘struct std::variant_alternative<15, std::variant<char, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int, long unsigned int, unsigned int, double, float, sdf::v9::Time, ignition::math::v6::Angle, ignition::math::v6::Color, ignition::math::v6::Vector2<int>, ignition::math::v6::Vector2<double>, ignition::math::v6::Vector3<double>, ignition::math::v6::Quaternion<double>, ignition::math::v6::Pose3<double> > >’
/usr/include/c++/9/variant:100:12:   required from ‘struct std::variant_alternative<16, std::variant<bool, char, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int, long unsigned int, unsigned int, double, float, sdf::v9::Time, ignition::math::v6::Angle, ignition::math::v6::Color, ignition::math::v6::Vector2<int>, ignition::math::v6::Vector2<double>, ignition::math::v6::Vector3<double>, ignition::math::v6::Quaternion<double>, ignition::math::v6::Pose3<double> > >’
/usr/include/c++/9/variant:1110:5:   required by substitution of ‘template<long unsigned int _Np, class ... _Types> constexpr std::add_pointer_t<const typename std::variant_alternative<_Np, std::variant<_Types ...> >::type> std::get_if(const std::variant<_Types ...>*) [with long unsigned int _Np = 16; _Types = {bool, char, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int, long unsigned int, unsigned int, double, float, sdf::v9::Time, ignition::math::v6::Angle, ignition::math::v6::Color, ignition::math::v6::Vector2<int>, ignition::math::v6::Vector2<double>, ignition::math::v6::Vector3<double>, ignition::math::v6::Quaternion<double>, ignition::math::v6::Pose3<double>}]’
/usr/include/c++/9/variant:1128:76:   required from ‘constexpr std::add_pointer_t<_Tp> std::get_if(std::variant<_Types ...>*) [with _Tp = short unsigned int; _Types = {bool, char, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int, long unsigned int, unsigned int, double, float, sdf::v9::Time, ignition::math::v6::Angle, ignition::math::v6::Color, ignition::math::v6::Vector2<int>, ignition::math::v6::Vector2<double>, ignition::math::v6::Vector3<double>, ignition::math::v6::Quaternion<double>, ignition::math::v6::Pose3<double>}; std::add_pointer_t<_Tp> = short unsigned int*]’
/usr/include/sdformat-9.5/sdf/Param.hh:318:34:   required from ‘bool sdf::v9::Param::Get(T&) const [with T = short unsigned int]’
/usr/include/sdformat-9.5/sdf/Element.hh:511:7:   required from ‘std::pair<T, bool> sdf::v9::Element::Get(const string&, const T&) const [with T = short unsigned int; std::string = std::__cxx11::basic_string<char>]’
/home/chris/ardupilot_gazebo/src/ArduPilotPlugin.cc:879:57:   required from here
/usr/include/c++/9/variant:100:12: error: invalid use of incomplete type ‘struct std::variant_alternative<0, std::variant<> >’
  100 |     struct variant_alternative<_Np, variant<_First, _Rest...>>
      |            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/9/variant:97:12: note: declaration of ‘struct std::variant_alternative<0, std::variant<> >’
   97 |     struct variant_alternative;
      |            ^~~~~~~~~~~~~~~~~~~
/usr/include/c++/9/variant: In instantiation of ‘constexpr std::add_pointer_t<_Tp> std::get_if(std::variant<_Types ...>*) [with _Tp = short unsigned int; _Types = {bool, char, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int, long unsigned int, unsigned int, double, float, sdf::v9::Time, ignition::math::v6::Angle, ignition::math::v6::Color, ignition::math::v6::Vector2<int>, ignition::math::v6::Vector2<double>, ignition::math::v6::Vector3<double>, ignition::math::v6::Quaternion<double>, ignition::math::v6::Pose3<double>}; std::add_pointer_t<_Tp> = short unsigned int*]’:
/usr/include/sdformat-9.5/sdf/Param.hh:318:34:   required from ‘bool sdf::v9::Param::Get(T&) const [with T = short unsigned int]’
/usr/include/sdformat-9.5/sdf/Element.hh:511:7:   required from ‘std::pair<T, bool> sdf::v9::Element::Get(const string&, const T&) const [with T = short unsigned int; std::string = std::__cxx11::basic_string<char>]’
/home/chris/ardupilot_gazebo/src/ArduPilotPlugin.cc:879:57:   required from here
/usr/include/c++/9/variant:1128:76: error: no matching function for call to ‘get_if<std::__detail::__variant::__index_of_v<short unsigned int, bool, char, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int, long unsigned int, unsigned int, double, float, sdf::v9::Time, ignition::math::v6::Angle, ignition::math::v6::Color, ignition::math::v6::Vector2<int>, ignition::math::v6::Vector2<double>, ignition::math::v6::Vector3<double>, ignition::math::v6::Quaternion<double>, ignition::math::v6::Pose3<double> > >(std::variant<bool, char, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int, long unsigned int, unsigned int, double, float, sdf::v9::Time, ignition::math::v6::Angle, ignition::math::v6::Color, ignition::math::v6::Vector2<int>, ignition::math::v6::Vector2<double>, ignition::math::v6::Vector3<double>, ignition::math::v6::Quaternion<double>, ignition::math::v6::Pose3<double> >*&)’
 1128 |       return std::get_if<__detail::__variant::__index_of_v<_Tp, _Types...>>(
      |              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
 1129 |    __ptr);
      |    ~~~~~~                                                                   
/usr/include/c++/9/variant:1096:5: note: candidate: ‘template<long unsigned int _Np, class ... _Types> constexpr std::add_pointer_t<typename std::variant_alternative<_Np, std::variant<_Types ...> >::type> std::get_if(std::variant<_Types ...>*)’
 1096 |     get_if(variant<_Types...>* __ptr) noexcept
      |     ^~~~~~
/usr/include/c++/9/variant:1096:5: note:   template argument deduction/substitution failed:
/usr/include/c++/9/variant: In substitution of ‘template<long unsigned int _Np, class ... _Types> constexpr std::add_pointer_t<typename std::variant_alternative<_Np, std::variant<_Types ...> >::type> std::get_if(std::variant<_Types ...>*) [with long unsigned int _Np = 16; _Types = {bool, char, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int, long unsigned int, unsigned int, double, float, sdf::v9::Time, ignition::math::v6::Angle, ignition::math::v6::Color, ignition::math::v6::Vector2<int>, ignition::math::v6::Vector2<double>, ignition::math::v6::Vector3<double>, ignition::math::v6::Quaternion<double>, ignition::math::v6::Pose3<double>}]’:
/usr/include/c++/9/variant:1128:76:   required from ‘constexpr std::add_pointer_t<_Tp> std::get_if(std::variant<_Types ...>*) [with _Tp = short unsigned int; _Types = {bool, char, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int, long unsigned int, unsigned int, double, float, sdf::v9::Time, ignition::math::v6::Angle, ignition::math::v6::Color, ignition::math::v6::Vector2<int>, ignition::math::v6::Vector2<double>, ignition::math::v6::Vector3<double>, ignition::math::v6::Quaternion<double>, ignition::math::v6::Pose3<double>}; std::add_pointer_t<_Tp> = short unsigned int*]’
/usr/include/sdformat-9.5/sdf/Param.hh:318:34:   required from ‘bool sdf::v9::Param::Get(T&) const [with T = short unsigned int]’
/usr/include/sdformat-9.5/sdf/Element.hh:511:7:   required from ‘std::pair<T, bool> sdf::v9::Element::Get(const string&, const T&) const [with T = short unsigned int; std::string = std::__cxx11::basic_string<char>]’
/home/chris/ardupilot_gazebo/src/ArduPilotPlugin.cc:879:57:   required from here
/usr/include/c++/9/variant:1096:5: error: no type named ‘type’ in ‘struct std::variant_alternative<16, std::variant<bool, char, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int, long unsigned int, unsigned int, double, float, sdf::v9::Time, ignition::math::v6::Angle, ignition::math::v6::Color, ignition::math::v6::Vector2<int>, ignition::math::v6::Vector2<double>, ignition::math::v6::Vector3<double>, ignition::math::v6::Quaternion<double>, ignition::math::v6::Pose3<double> > >’
/usr/include/c++/9/variant: In instantiation of ‘constexpr std::add_pointer_t<_Tp> std::get_if(std::variant<_Types ...>*) [with _Tp = short unsigned int; _Types = {bool, char, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, int, long unsigned int, unsigned int, double, float, sdf::v9::Time, ignition::math::v6::Angle, ignition::math::v6::Color, ignition::math::v6::Vector2<int>, ignition::math::v6::Vector2<double>, ignition::math::v6::Vector3<double>, ignition::math::v6::Quaternion<double>, ignition::math::v6::Pose3<double>}; std::add_pointer_t<_Tp> = short unsigned int*]’:
/usr/include/sdformat-9.5/sdf/Param.hh:318:34:   required from ‘bool sdf::v9::Param::Get(T&) const [with T = short unsigned int]’
/usr/include/sdformat-9.5/sdf/Element.hh:511:7:   required from ‘std::pair<T, bool> sdf::v9::Element::Get(const string&, const T&) const [with T = short unsigned int; std::string = std::__cxx11::basic_string<char>]’
/home/chris/ardupilot_gazebo/src/ArduPilotPlugin.cc:879:57:   required from here
/usr/include/c++/9/variant:1110:5: note: candidate: ‘template<long unsigned int _Np, class ... _Types> constexpr std::add_pointer_t<const typename std::variant_alternative<_Np, std::variant<_Types ...> >::type> std::get_if(const std::variant<_Types ...>*)’
 1110 |     get_if(const variant<_Types...>* __ptr) noexcept
      |     ^~~~~~
/usr/include/c++/9/variant:1110:5: note:   substitution of deduced template arguments resulted in errors seen above
/usr/include/c++/9/variant:1123:5: note: candidate: ‘template<class _Tp, class ... _Types> constexpr std::add_pointer_t<_Tp> std::get_if(std::variant<_Types ...>*)’
 1123 |     get_if(variant<_Types...>* __ptr) noexcept
      |     ^~~~~~
/usr/include/c++/9/variant:1123:5: note:   template argument deduction/substitution failed:
/home/chris/ardupilot_gazebo/src/ArduPilotPlugin.cc: In instantiation of ‘void __gnu_cxx::new_allocator<_Tp>::construct(_Up*, _Args&& ...) [with _Up = Control; _Args = {Control}; _Tp = Control]’:
/usr/include/c++/9/bits/alloc_traits.h:484:4:   required from ‘static void std::allocator_traits<std::allocator<_CharT> >::construct(std::allocator_traits<std::allocator<_CharT> >::allocator_type&, _Up*, _Args&& ...) [with _Up = Control; _Args = {Control}; _Tp = Control; std::allocator_traits<std::allocator<_CharT> >::allocator_type = std::allocator<Control>]’
/usr/include/c++/9/bits/stl_uninitialized.h:912:26:   required from ‘void std::__relocate_object_a(_Tp*, _Up*, _Allocator&) [with _Tp = Control; _Up = Control; _Allocator = std::allocator<Control>]’
/usr/include/c++/9/bits/stl_uninitialized.h:950:26:   required from ‘_ForwardIterator std::__relocate_a_1(_InputIterator, _InputIterator, _ForwardIterator, _Allocator&) [with _InputIterator = Control*; _ForwardIterator = Control*; _Allocator = std::allocator<Control>]’
/usr/include/c++/9/bits/stl_uninitialized.h:964:28:   required from ‘_ForwardIterator std::__relocate_a(_InputIterator, _InputIterator, _ForwardIterator, _Allocator&) [with _InputIterator = Control*; _ForwardIterator = Control*; _Allocator = std::allocator<Control>]’
/usr/include/c++/9/bits/stl_vector.h:453:26:   required from ‘static std::vector<_Tp, _Alloc>::pointer std::vector<_Tp, _Alloc>::_S_do_relocate(std::vector<_Tp, _Alloc>::pointer, std::vector<_Tp, _Alloc>::pointer, std::vector<_Tp, _Alloc>::pointer, std::vector<_Tp, _Alloc>::_Tp_alloc_type&, std::true_type) [with _Tp = Control; _Alloc = std::allocator<Control>; std::vector<_Tp, _Alloc>::pointer = Control*; std::vector<_Tp, _Alloc>::_Tp_alloc_type = std::allocator<Control>; std::true_type = std::integral_constant<bool, true>]’
/usr/include/c++/9/bits/stl_vector.h:466:23:   required from ‘static std::vector<_Tp, _Alloc>::pointer std::vector<_Tp, _Alloc>::_S_relocate(std::vector<_Tp, _Alloc>::pointer, std::vector<_Tp, _Alloc>::pointer, std::vector<_Tp, _Alloc>::pointer, std::vector<_Tp, _Alloc>::_Tp_alloc_type&) [with _Tp = Control; _Alloc = std::allocator<Control>; std::vector<_Tp, _Alloc>::pointer = Control*; std::vector<_Tp, _Alloc>::_Tp_alloc_type = std::allocator<Control>]’
/usr/include/c++/9/bits/vector.tcc:461:34:   required from ‘void std::vector<_Tp, _Alloc>::_M_realloc_insert(std::vector<_Tp, _Alloc>::iterator, _Args&& ...) [with _Args = {const Control&}; _Tp = Control; _Alloc = std::allocator<Control>; std::vector<_Tp, _Alloc>::iterator = __gnu_cxx::__normal_iterator<Control*, std::vector<Control> >; typename std::_Vector_base<_Tp, _Alloc>::pointer = Control*]’
/usr/include/c++/9/bits/stl_vector.h:1195:4:   required from ‘void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = Control; _Alloc = std::allocator<Control>; std::vector<_Tp, _Alloc>::value_type = Control]’
/home/chris/ardupilot_gazebo/src/ArduPilotPlugin.cc:622:46:   required from here
/home/chris/ardupilot_gazebo/src/ArduPilotPlugin.cc:109:7: warning: implicitly-declared ‘constexpr gazebo::common::PID::PID(const gazebo::common::PID&)’ is deprecated [-Wdeprecated-copy]
  109 | class Control
      |       ^~~~~~~
In file included from /usr/include/gazebo-11/gazebo/physics/JointController.hh:25,
                 from /usr/include/gazebo-11/gazebo/physics/physics.hh:23,
                 from /usr/include/gazebo-11/gazebo/sensors/WirelessTransmitter.hh:22,
                 from /usr/include/gazebo-11/gazebo/sensors/sensors.hh:27,
                 from /home/chris/ardupilot_gazebo/src/ArduPilotPlugin.cc:46:
/usr/include/gazebo-11/gazebo/common/PID.hh:157:20: note: because ‘gazebo::common::PID’ has user-provided ‘gazebo::common::PID& gazebo::common::PID::operator=(const gazebo::common::PID&)’
  157 |       public: PID &operator=(const PID &_p)
      |                    ^~~~~~~~
In file included from /usr/include/x86_64-linux-gnu/c++/9/bits/c++allocator.h:33,
                 from /usr/include/c++/9/bits/allocator.h:46,
                 from /usr/include/c++/9/string:41,
                 from /usr/include/c++/9/stdexcept:39,
                 from /usr/include/c++/9/array:39,
                 from /usr/include/c++/9/tuple:39,
                 from /usr/include/c++/9/functional:54,
                 from /home/chris/ardupilot_gazebo/src/ArduPilotPlugin.cc:17:
/usr/include/c++/9/ext/new_allocator.h:147:4: note: synthesized method ‘Control::Control(Control&&)’ first required here
  147 |  { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); }
      |    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
make[2]: *** [CMakeFiles/ArduPilotPlugin.dir/build.make:63: CMakeFiles/ArduPilotPlugin.dir/src/ArduPilotPlugin.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:78: CMakeFiles/ArduPilotPlugin.dir/all] Error 2
make: *** [Makefile:130: all] Error 2
chris@Ubuntuchris:~/ardupilot_gazebo/build$ 
@baaazo
Copy link

baaazo commented Mar 5, 2021

Yup same thing here, hope it gets fixed :(

@amilcarlucas
Copy link

Hello Pierre, can you take a look at this?

@MuhammadHaroon-S2H
Copy link

Was it fixed? Or
Were you able to resolve this?

@baaazo
Copy link

baaazo commented Feb 4, 2022

Sadly i couldnt resolve this

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

Successfully merging a pull request may close this issue.

4 participants