• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

TFS 1.X+ Compiling error

jel

Member
Joined
Mar 22, 2014
Messages
209
Reaction score
8
good morning, I have this error when trying to compile

Lua:
In file included from /usr/include/x86_64-linux-gnu/c++/5/bits/c++allocator.h:33:0,
                 from /usr/include/c++/5/bits/allocator.h:46,
                 from /usr/include/c++/5/string:41,
                 from /usr/include/c++/5/random:40,
                 from /usr/include/c++/5/bits/stl_algo.h:66,
                 from /usr/include/c++/5/algorithm:62,
                 from /home/source/src/otpch.h:26,
                 from /home/source/src/game.cpp:20:
/usr/include/c++/5/ext/new_allocator.h: In instantiation of ‘void __gnu_cxx::new_allocator< <template-parameter-1-1> >::construct(_Up*, _Args&& ...) [with _Up = std::pair<const std::__cxx11::basic_string<char>, ItemAttributes::CustomAttribute>; _Args = {std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, long int&}; _Tp = std::pair<const std::__cxx11::basic_string<char>, ItemAttributes::CustomAttribute>]’:
/usr/include/c++/5/bits/alloc_traits.h:530:4:   required from ‘static void std::allocator_traits<std::allocator<_Tp> >::construct(std::allocator_traits<std::allocator<_Tp> >::allocator_type&, _Up*, _Args&& ...) [with _Up = std::pair<const std::__cxx11::basic_string<char>, ItemAttributes::CustomAttribute>; _Args = {std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, long int&}; _Tp = std::pair<const std::__cxx11::basic_string<char>, ItemAttributes::CustomAttribute>; std::allocator_traits<std::allocator<_Tp> >::allocator_type = std::allocator<std::pair<const std::__cxx11::basic_string<char>, ItemAttributes::CustomAttribute> >]’
/usr/include/c++/5/bits/hashtable_policy.h:1955:37:   required from ‘std::__detail::_Hashtable_alloc<_NodeAlloc>::__node_type* std::__detail::_Hashtable_alloc<_NodeAlloc>::_M_allocate_node(_Args&& ...) [with _Args = {std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, long int&}; _NodeAlloc = std::allocator<std::__detail::_Hash_node<std::pair<const std::__cxx11::basic_string<char>, ItemAttributes::CustomAttribute>, true> >; std::__detail::_Hashtable_alloc<_NodeAlloc>::__node_type = std::__detail::_Hash_node<std::pair<const std::__cxx11::basic_string<char>, ItemAttributes::CustomAttribute>, true>]’
/usr/include/c++/5/bits/hashtable.h:1526:77:   required from ‘std::pair<typename std::__detail::_Hashtable_base<_Key, _Value, _ExtractKey, _Equal, _H1, _H2, _Hash, _Traits>::iterator, bool> std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::_M_emplace(std::true_type, _Args&& ...) [with _Args = {std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, long int&}; _Key = std::__cxx11::basic_string<char>; _Value = std::pair<const std::__cxx11::basic_string<char>, ItemAttributes::CustomAttribute>; _Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, ItemAttributes::CustomAttribute> >; _ExtractKey = std::__detail::_Select1st; _Equal = std::equal_to<std::__cxx11::basic_string<char> >; _H1 = std::hash<std::__cxx11::basic_string<char> >; _H2 = std::__detail::_Mod_range_hashing; _Hash = std::__detail::_Default_ranged_hash; _RehashPolicy = std::__detail::_Prime_rehash_policy; _Traits = std::__detail::_Hashtable_traits<true, false, true>; typename std::__detail::_Hashtable_base<_Key, _Value, _ExtractKey, _Equal, _H1, _H2, _Hash, _Traits>::iterator = std::__detail::_Node_iterator<std::pair<const std::__cxx11::basic_string<char>, ItemAttributes::CustomAttribute>, false, true>; std::true_type = std::integral_constant<bool, true>]’
/usr/include/c++/5/bits/hashtable.h:726:21:   required from ‘std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::__ireturn_type std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::emplace(_Args&& ...) [with _Args = {std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, long int&}; _Key = std::__cxx11::basic_string<char>; _Value = std::pair<const std::__cxx11::basic_string<char>, ItemAttributes::CustomAttribute>; _Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, ItemAttributes::CustomAttribute> >; _ExtractKey = std::__detail::_Select1st; _Equal = std::equal_to<std::__cxx11::basic_string<char> >; _H1 = std::hash<std::__cxx11::basic_string<char> >; _H2 = std::__detail::_Mod_range_hashing; _Hash = std::__detail::_Default_ranged_hash; _RehashPolicy = std::__detail::_Prime_rehash_policy; _Traits = std::__detail::_Hashtable_traits<true, false, true>; std::_Hashtable<_Key, _Value, _Alloc, _ExtractKey, _Equal, _H1, _H2, _Hash, _RehashPolicy, _Traits>::__ireturn_type = std::pair<std::__detail::_Node_iterator<std::pair<const std::__cxx11::basic_string<char>, ItemAttributes::CustomAttribute>, false, true>, bool>]’
/usr/include/c++/5/bits/unordered_map.h:380:54:   required from ‘std::pair<typename std::_Hashtable<_Key, std::pair<const _Key, _Tp>, _Alloc, std::__detail::_Select1st, _Pred, _Hash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<std::__not_<std::__and_<std::__is_fast_hash<_Hash>, std::__detail::__is_noexcept_hash<_Key, _Hash> > >::value, false, true> >::iterator, bool> std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::emplace(_Args&& ...) [with _Args = {std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, long int&}; _Key = std::__cxx11::basic_string<char>; _Tp = ItemAttributes::CustomAttribute; _Hash = std::hash<std::__cxx11::basic_string<char> >; _Pred = std::equal_to<std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::pair<const std::__cxx11::basic_string<char>, ItemAttributes::CustomAttribute> >; typename std::_Hashtable<_Key, std::pair<const _Key, _Tp>, _Alloc, std::__detail::_Select1st, _Pred, _Hash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<std::__not_<std::__and_<std::__is_fast_hash<_Hash>, std::__detail::__is_noexcept_hash<_Key, _Hash> > >::value, false, true> >::iterator = std::__detail::_Node_iterator<std::pair<const std::__cxx11::basic_string<char>, ItemAttributes::CustomAttribute>, false, true>]’
/home/source/src/item.h:463:4:   required from ‘void ItemAttributes::setCustomAttribute(std::__cxx11::string&, R) [with R = long int; std::__cxx11::string = std::__cxx11::basic_string<char>]’
/home/source/src/item.h:644:4:   required from ‘void Item::setCustomAttribute(std::__cxx11::string&, R) [with R = long int; std::__cxx11::string = std::__cxx11::basic_string<char>]’
/home/source/src/game.cpp:3445:88:   required from here
/usr/include/c++/5/ext/new_allocator.h:120:4: error: no matching function for call to ‘std::pair<const std::__cxx11::basic_string<char>, ItemAttributes::CustomAttribute>::pair(std::__cxx11::basic_string<char>&, long int&)’
  { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); }
    ^
In file included from /usr/include/c++/5/utility:70:0,
                 from /usr/include/c++/5/algorithm:60,
                 from /home/source/src/otpch.h:26,
                 from /home/source/src/game.cpp:20:
/usr/include/c++/5/bits/stl_pair.h:206:9: note: candidate: template<class ... _Args1, long unsigned int ..._Indexes1, class ... _Args2, long unsigned int ..._Indexes2> std::pair<_T1, _T2>::pair(std::tuple<_Args1 ...>&, std::tuple<_Args2 ...>&, std::_Index_tuple<_Indexes1 ...>, std::_Index_tuple<_Indexes2 ...>)
         pair(tuple<_Args1...>&, tuple<_Args2...>&,
         ^
/usr/include/c++/5/bits/stl_pair.h:206:9: note:   template argument deduction/substitution failed:
In file included from /usr/include/x86_64-linux-gnu/c++/5/bits/c++allocator.h:33:0,
                 from /usr/include/c++/5/bits/allocator.h:46,
                 from /usr/include/c++/5/string:41,
                 from /usr/include/c++/5/random:40,
                 from /usr/include/c++/5/bits/stl_algo.h:66,
                 from /usr/include/c++/5/algorithm:62,
                 from /home/source/src/otpch.h:26,
                 from /home/source/src/game.cpp:20:
/usr/include/c++/5/ext/new_allocator.h:120:4: note:   ‘std::__cxx11::basic_string<char>’ is not derived from ‘std::tuple<_Elements ...>’
  { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); }
    ^
In file included from /usr/include/c++/5/utility:70:0,
                 from /usr/include/c++/5/algorithm:60,
                 from /home/source/src/otpch.h:26,
                 from /home/source/src/game.cpp:20:
/usr/include/c++/5/bits/stl_pair.h:155:9: note: candidate: template<class ... _Args1, class ... _Args2> std::pair<_T1, _T2>::pair(std::piecewise_construct_t, std::tuple<_Args1 ...>, std::tuple<_Args2 ...>)
         pair(piecewise_construct_t, tuple<_Args1...>, tuple<_Args2...>);
         ^
/usr/include/c++/5/bits/stl_pair.h:155:9: note:   template argument deduction/substitution failed:
In file included from /usr/include/x86_64-linux-gnu/c++/5/bits/c++allocator.h:33:0,
                 from /usr/include/c++/5/bits/allocator.h:46,
                 from /usr/include/c++/5/string:41,
                 from /usr/include/c++/5/random:40,
                 from /usr/include/c++/5/bits/stl_algo.h:66,
                 from /usr/include/c++/5/algorithm:62,
                 from /home/source/src/otpch.h:26,
                 from /home/source/src/game.cpp:20:
/usr/include/c++/5/ext/new_allocator.h:120:4: note:   cannot convert ‘std::forward<std::__cxx11::basic_string<char>&>((* & __args#0))’ (type ‘std::__cxx11::basic_string<char>’) to type ‘std::piecewise_construct_t’
  { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); }
    ^
In file included from /usr/include/c++/5/utility:70:0,
                 from /usr/include/c++/5/algorithm:60,
                 from /home/source/src/otpch.h:26,
                 from /home/source/src/game.cpp:20:
/usr/include/c++/5/bits/stl_pair.h:150:12: note: candidate: template<class _U1, class _U2, class> constexpr std::pair<_T1, _T2>::pair(std::pair<_U1, _U2>&&)
  constexpr pair(pair<_U1, _U2>&& __p)
            ^
/usr/include/c++/5/bits/stl_pair.h:150:12: note:   template argument deduction/substitution failed:
In file included from /usr/include/x86_64-linux-gnu/c++/5/bits/c++allocator.h:33:0,
                 from /usr/include/c++/5/bits/allocator.h:46,
                 from /usr/include/c++/5/string:41,
                 from /usr/include/c++/5/random:40,
                 from /usr/include/c++/5/bits/stl_algo.h:66,
                 from /usr/include/c++/5/algorithm:62,
                 from /home/source/src/otpch.h:26,
                 from /home/source/src/game.cpp:20:
/usr/include/c++/5/ext/new_allocator.h:120:4: note:   ‘std::__cxx11::basic_string<char>’ is not derived from ‘std::pair<_T1, _T2>’
  { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); }
    ^
In file included from /usr/include/c++/5/utility:70:0,
                 from /usr/include/c++/5/algorithm:60,
                 from /home/source/src/otpch.h:26,
                 from /home/source/src/game.cpp:20:
/usr/include/c++/5/bits/stl_pair.h:144:12: note: candidate: template<class _U1, class _U2, class> constexpr std::pair<_T1, _T2>::pair(_U1&&, _U2&&)
  constexpr pair(_U1&& __x, _U2&& __y)
            ^
/usr/include/c++/5/bits/stl_pair.h:144:12: note:   template argument deduction/substitution failed:
/usr/include/c++/5/bits/stl_pair.h:141:38: error: no type named ‘type’ in ‘struct std::enable_if<false, void>’
       template<class _U1, class _U2, class = typename
                                      ^
/usr/include/c++/5/bits/stl_pair.h:138:12: note: candidate: template<class _U2, class> constexpr std::pair<_T1, _T2>::pair(const _T1&, _U2&&)
  constexpr pair(const _T1& __x, _U2&& __y)
            ^
/usr/include/c++/5/bits/stl_pair.h:138:12: note:   template argument deduction/substitution failed:
/usr/include/c++/5/bits/stl_pair.h:136:27: error: no type named ‘type’ in ‘struct std::enable_if<false, void>’
       template<class _U2, class = typename
                           ^
/usr/include/c++/5/bits/stl_pair.h:133:12: note: candidate: template<class _U1, class> constexpr std::pair<_T1, _T2>::pair(_U1&&, const _T2&)
  constexpr pair(_U1&& __x, const _T2& __y)
            ^
/usr/include/c++/5/bits/stl_pair.h:133:12: note:   template argument deduction/substitution failed:
In file included from /usr/include/x86_64-linux-gnu/c++/5/bits/c++allocator.h:33:0,
                 from /usr/include/c++/5/bits/allocator.h:46,
                 from /usr/include/c++/5/string:41,
                 from /usr/include/c++/5/random:40,
                 from /usr/include/c++/5/bits/stl_algo.h:66,
                 from /usr/include/c++/5/algorithm:62,
                 from /home/source/src/otpch.h:26,
                 from /home/source/src/game.cpp:20:
/usr/include/c++/5/ext/new_allocator.h:120:4: note:   cannot convert ‘std::forward<long int&>((* & __args#1))’ (type ‘long int’) to type ‘const ItemAttributes::CustomAttribute&’
  { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); }
    ^
In file included from /usr/include/c++/5/utility:70:0,
                 from /usr/include/c++/5/algorithm:60,
                 from /home/source/src/otpch.h:26,
                 from /home/source/src/game.cpp:20:
/usr/include/c++/5/bits/stl_pair.h:128:17: note: candidate: constexpr std::pair<_T1, _T2>::pair(std::pair<_T1, _T2>&&) [with _T1 = const std::__cxx11::basic_string<char>; _T2 = ItemAttributes::CustomAttribute]
       constexpr pair(pair&&) = default;
                 ^
/usr/include/c++/5/bits/stl_pair.h:128:17: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/5/bits/stl_pair.h:127:17: note: candidate: constexpr std::pair<_T1, _T2>::pair(const std::pair<_T1, _T2>&) [with _T1 = const std::__cxx11::basic_string<char>; _T2 = ItemAttributes::CustomAttribute]
       constexpr pair(const pair&) = default;
                 ^
/usr/include/c++/5/bits/stl_pair.h:127:17: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/5/bits/stl_pair.h:124:12: note: candidate: template<class _U1, class _U2, class> constexpr std::pair<_T1, _T2>::pair(const std::pair<_U1, _U2>&)
  constexpr pair(const pair<_U1, _U2>& __p)
            ^
/usr/include/c++/5/bits/stl_pair.h:124:12: note:   template argument deduction/substitution failed:
In file included from /usr/include/x86_64-linux-gnu/c++/5/bits/c++allocator.h:33:0,
                 from /usr/include/c++/5/bits/allocator.h:46,
                 from /usr/include/c++/5/string:41,
                 from /usr/include/c++/5/random:40,
                 from /usr/include/c++/5/bits/stl_algo.h:66,
                 from /usr/include/c++/5/algorithm:62,
                 from /home/source/src/otpch.h:26,
                 from /home/source/src/game.cpp:20:
/usr/include/c++/5/ext/new_allocator.h:120:4: note:   ‘std::__cxx11::basic_string<char>’ is not derived from ‘const std::pair<_T1, _T2>’
  { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); }
    ^
In file included from /usr/include/c++/5/utility:70:0,
                 from /usr/include/c++/5/algorithm:60,
                 from /home/source/src/otpch.h:26,
                 from /home/source/src/game.cpp:20:
/usr/include/c++/5/bits/stl_pair.h:112:26: note: candidate: constexpr std::pair<_T1, _T2>::pair(const _T1&, const _T2&) [with _T1 = const std::__cxx11::basic_string<char>; _T2 = ItemAttributes::CustomAttribute]
       _GLIBCXX_CONSTEXPR pair(const _T1& __a, const _T2& __b)
                          ^
/usr/include/c++/5/bits/stl_pair.h:112:26: note:   no known conversion for argument 2 from ‘long int’ to ‘const ItemAttributes::CustomAttribute&’
/usr/include/c++/5/bits/stl_pair.h:108:26: note: candidate: constexpr std::pair<_T1, _T2>::pair() [with _T1 = const std::__cxx11::basic_string<char>; _T2 = ItemAttributes::CustomAttribute]
       _GLIBCXX_CONSTEXPR pair()
                          ^
/usr/include/c++/5/bits/stl_pair.h:108:26: note:   candidate expects 0 arguments, 2 provided
CMakeFiles/otbr_lib.dir/build.make:614: recipe for target 'CMakeFiles/otbr_lib.dir/src/game.cpp.o' failed
make[2]: *** [CMakeFiles/otbr_lib.dir/src/game.cpp.o] Error 1
CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/otbr_lib.dir/all' failed
make[1]: *** [CMakeFiles/otbr_lib.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
 
OP
OP
J

jel

Member
Joined
Mar 22, 2014
Messages
209
Reaction score
8
what's on game.cpp:3445 ?
line:3445 key = "LookType"; item->setCustomAttribute(key, static_cast<int64_t>(outfit.lookType));

Lua:
if (outfit.lookType != 0) {
        key = "LookType"; item->setCustomAttribute(key, static_cast<int64_t>(outfit.lookType));
        key = "LookHead"; item->setCustomAttribute(key, static_cast<int64_t>(outfit.lookHead));
        key = "LookBody"; item->setCustomAttribute(key, static_cast<int64_t>(outfit.lookBody));
        key = "LookLegs"; item->setCustomAttribute(key, static_cast<int64_t>(outfit.lookLegs));
        key = "LookFeet"; item->setCustomAttribute(key, static_cast<int64_t>(outfit.lookFeet));
        key = "LookAddons"; item->setCustomAttribute(key, static_cast<int64_t>(outfit.lookAddons));
    } else {
        item->removeCustomAttribute("LookType");
    }
 
Top