multiple definition of `std::__detail::__clp2(unsigned int)', gcc-linaro

124 Views Asked by At

I am using gcc-linaro-12.0.1-2022.02-x86_64_arm-linux-gnueabihf arm toolchain.

I could not figure out why I am getting multiple definition of standard __clp2 function. I have checked include guards in my header files.

It seems it is related to unordered_map as I understood from object files. Both object files has include directive of <unordered_map> header.

I am sorry because of my company privacy issues I cant share source files. But I have added related part of object files.

Compiler output is below.

/linaro/gcc-linaro-12.0.1-2022.02-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/12.0.1/../../../../arm-linux-gnueabihf/bin/ld: 
obj/x.o: in function `std::__detail::__clp2(unsigned int)':x.cpp:(.text+0x0): 
multiple definition of `std::__detail::__clp2(unsigned int)'; 
obj/y.o:y.cpp:(.text+0x10): first defined here
collect2: error: ld returned 1 exit status

X object file

00000000 W std::vector<unsigned char, std::allocator<unsigned char> >::end()
00000000 W std::vector<unsigned char, std::allocator<unsigned char> >::begin()
00000000 W std::vector<unsigned char, std::allocator<unsigned char> >::clear()
00000000 W std::vector<unsigned char, std::allocator<unsigned char> >::operator=(std::vector<unsigned char, std::allocator<unsigned char> > const&)
00000000 W std::vector<unsigned char, std::allocator<unsigned char> >::vector(std::vector<unsigned char, std::allocator<unsigned char> > const&)
00000000 W std::vector<unsigned char, std::allocator<unsigned char> >::vector()
00000000 W std::vector<unsigned char, std::allocator<unsigned char> >::vector(std::vector<unsigned char, std::allocator<unsigned char> > const&)
00000000 W std::vector<unsigned char, std::allocator<unsigned char> >::vector()
00000000 n std::vector<unsigned char, std::allocator<unsigned char> >::vector(std::vector<unsigned char, std::allocator<unsigned char> > const&)
00000000 n std::vector<unsigned char, std::allocator<unsigned char> >::vector()
00000000 W std::vector<unsigned char, std::allocator<unsigned char> >::~vector()
00000000 W std::vector<unsigned char, std::allocator<unsigned char> >::~vector()
00000000 n std::vector<unsigned char, std::allocator<unsigned char> >::~vector()
         U std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::append(char const*, unsigned int)
         U std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::append(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
         U std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::insert(unsigned int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
         U std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::reserve(unsigned int)
         U std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator=(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&)
         U std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator=(char const*)
         U std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(unsigned int, char, std::allocator<char> const&)
         U std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&)
         U std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(char const*, std::allocator<char> const&)
         U std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::allocator<char> const&)
         U std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
         U std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string()
         U std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::~basic_string()
         U std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator[](unsigned int)
         U std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator+=(char const*)
00000000 W std::__cxx11::to_string(int)
00000000 W unsigned int std::__detail::__to_chars_len<unsigned int>(unsigned int, int)
00000000 W void std::__detail::__to_chars_10_impl<unsigned int>(char*, unsigned int, unsigned int)

> 00000000 T std::__detail::__clp2(unsigned int)

         U std::ios_base::Init::Init()
         U std::ios_base::Init::~Init()

Y object file

00000000 W std::__detail::_Prime_rehash_policy::_M_reset(unsigned int)
00000000 W std::__detail::_Prime_rehash_policy::_Prime_rehash_policy(float)
00000000 W std::__detail::_Prime_rehash_policy::_Prime_rehash_policy(float)
00000000 n std::__detail::_Prime_rehash_policy::_Prime_rehash_policy(float)
00000000 W std::__detail::_Hash_node_value_base<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >::_M_v()
00000000 W std::__detail::_Hash_node_value_base<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >::_M_valptr()
00000000 W std::__detail::_Hashtable_ebo_helper<0, std::allocator<std::__detail::_Hash_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, true> >, true>::_M_get()
00000000 W std::__detail::_Hashtable_ebo_helper<0, std::allocator<std::__detail::_Hash_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, true> >, true>::_Hashtable_ebo_helper()
00000000 W std::__detail::_Hashtable_ebo_helper<0, std::allocator<std::__detail::_Hash_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, true> >, true>::_Hashtable_ebo_helper()
00000000 n std::__detail::_Hashtable_ebo_helper<0, std::allocator<std::__detail::_Hash_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, true> >, true>::_Hashtable_ebo_helper()
00000000 W std::__detail::_Hashtable_ebo_helper<0, std::allocator<std::__detail::_Hash_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, true> >, true>::~_Hashtable_ebo_helper()
00000000 W std::__detail::_Hashtable_ebo_helper<0, std::allocator<std::__detail::_Hash_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, true> >, true>::~_Hashtable_ebo_helper()
00000000 n std::__detail::_Hashtable_ebo_helper<0, std::allocator<std::__detail::_Hash_node<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, true> >, true>::~_Hashtable_ebo_helper()
00000000 W std::__detail::_Hashtable_ebo_helper<0, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, true>::_Hashtable_ebo_helper()
00000000 W std::__detail::_Hashtable_ebo_helper<0, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, true>::_Hashtable_ebo_helper()
00000000 n std::__detail::_Hashtable_ebo_helper<0, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, true>::_Hashtable_ebo_helper()
00000000 W std::__detail::_Hashtable_ebo_helper<1, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, true>::_Hashtable_ebo_helper()
00000000 W std::__detail::_Hashtable_ebo_helper<1, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, true>::_Hashtable_ebo_helper()
00000000 n std::__detail::_Hashtable_ebo_helper<1, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, true>::_Hashtable_ebo_helper()
00000000 W std::__detail::_Hashtable_hash_traits<std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >::__small_size_threshold()

> 00000010 T std::__detail::__clp2(unsigned int)

00000000 W std::__detail::_Map_base<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >, std::__detail::_Select1st, std::equal_to<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::hash<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true>, true>::operator[](std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&)
00000000 W std::__detail::operator!=(std::__detail::_Node_iterator_base<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, true> const&, std::__detail::_Node_iterator_base<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, true> const&)
0

There are 0 best solutions below