Record Detail

Compile Error

In file included from /in/Compile/check.cpp:7:
/in/sokoban.hpp:124:44: error: implicit conversion changes signedness: 'int' to 'std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
            if(grid[i][0]!='#'||grid[i][col-1]!='#'){
                                ~~~~    ~~~^~
/in/sokoban.hpp:139:5: error: unknown type name 'Sokoban'
    Sokoban sokoban(grid);
    ^
/in/sokoban.hpp:263:37: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
                if (grids[newPlayer.row][newPlayer.col] == '#') continue;
                    ~~~~~ ~~~~~~~~~~^~~
/in/sokoban.hpp:263:52: error: implicit conversion changes signedness: 'int' to 'std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
                if (grids[newPlayer.row][newPlayer.col] == '#') continue;
                    ~~~~~                ~~~~~~~~~~^~~
/in/sokoban.hpp:274:42: error: implicit conversion changes signedness: 'int' to 'std::vector::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
                        if (grids[newBox.row][newBox.col] == '#' || 
                            ~~~~~ ~~~~~~~^~~
/in/sokoban.hpp:274:54: error: implicit conversion changes signedness: 'int' to 'std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::size_type' (aka 'unsigned long') [-Werror,-Wsign-conversion]
                        if (grids[newBox.row][newBox.col] == '#' || 
                            ~~~~~             ~~~~~~~^~~
In file included from /in/Compile/check.cpp:1:
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/iostream:39:
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/ostream:38:
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/ios:40:
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/char_traits.h:39:
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/stl_algobase.h:800:22: error: invalid operands to binary expression ('const Position' and 'const Position')
            if (!(*__first1 == *__first2))
                  ~~~~~~~~~ ^  ~~~~~~~~~
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/stl_algobase.h:831:38: note: in instantiation of function template specialization 'std::__equal<false>::equal<const Position *, const Position *>' requested here
      return std::__equal<__simple>::equal(__first1, __last1, __first2);
                                     ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/stl_algobase.h:1051:19: note: in instantiation of function template specialization 'std::__equal_aux<const Position *, const Position *>' requested here
      return std::__equal_aux(std::__niter_base(__first1),
                  ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/stl_vector.h:1603:16: note: in instantiation of function template specialization 'std::equal<__gnu_cxx::__normal_iterator<const Position *, std::vector<Position, std::allocator<Position> > >, __gnu_cxx::__normal_iterator<const Position *, std::vector<Position, std::allocator<Position> > > >' requested here
              && std::equal(__x.begin(), __x.end(), __y.begin())); }
                      ^
/in/sokoban.hpp:75:32: note: in instantiation of function template specialization 'std::operator==<Position, std::allocator<Position> >' requested here
        return PP==other.PP&&BP==other.BP;
                               ^
/in/sokoban.hpp:53:10: note: candidate function not viable: 'this' argument has type 'const Position', but method is not marked const
    bool operator==(const Position& other){
         ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/postypes.h:216:5: note: candidate template ignored: could not match 'fpos<type-parameter-0-0>' against 'const Position'
    operator==(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs)
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/stl_pair.h:448:5: note: candidate template ignored: could not match 'pair<type-parameter-0-0, type-parameter-0-1>' against 'const Position'
    operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/stl_iterator.h:302:5: note: candidate template ignored: could not match 'reverse_iterator<type-parameter-0-0>' against 'const Position'
    operator==(const reverse_iterator<_Iterator>& __x,
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/stl_iterator.h:340:5: note: candidate template ignored: could not match 'reverse_iterator<type-parameter-0-0>' against 'const Position'
    operator==(const reverse_iterator<_IteratorL>& __x,
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/stl_iterator.h:1121:5: note: candidate template ignored: could not match 'move_iterator<type-parameter-0-0>' against 'const Position'
    operator==(const move_iterator<_IteratorL>& __x,
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/stl_iterator.h:1127:5: note: candidate template ignored: could not match 'move_iterator<type-parameter-0-0>' against 'const Position'
    operator==(const move_iterator<_Iterator>& __x,
    ^
In file included from /in/Compile/check.cpp:1:
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/iostream:39:
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/ostream:38:
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/ios:42:
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/ios_base.h:41:
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/locale_classes.h:40:
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/string:48:
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/stl_function.h:356:20: error: invalid operands to binary expression ('const State' and 'const State')
      { return __x == __y; }
               ~~~ ^  ~~~
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/hashtable_policy.h:1433:42: note: in instantiation of member function 'std::equal_to<State>::operator()' requested here
    { return __c == __n->_M_hash_code && __eq(__k, __extract(__n->_M_v())); }
                                         ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/hashtable_policy.h:1814:28: note: in instantiation of member function 'std::__detail::_Equal_helper<State, std::pair<const State, int>, std::__detail::_Select1st, std::equal_to<State>, unsigned long, true>::_S_equals' requested here
      return _EqualHelper::_S_equals(_M_eq(), this->_M_extract(),
                           ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/hashtable.h:1551:14: note: in instantiation of member function 'std::__detail::_Hashtable_base<State, std::pair<const State, int>, std::__detail::_Select1st, std::equal_to<State>, ToHash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Hashtable_traits<true, false, true> >::_M_equals' requested here
          if (this->_M_equals(__k, __code, __p))
                    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/hashtable.h:642:28: note: in instantiation of member function 'std::_Hashtable<State, std::pair<const State, int>, std::allocator<std::pair<const State, int> >, std::__detail::_Select1st, std::equal_to<State>, ToHash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >::_M_find_before_node' requested here
        __node_base* __before_n = _M_find_before_node(__bkt, __key, __c);
                                  ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/hashtable_policy.h:721:31: note: in instantiation of member function 'std::_Hashtable<State, std::pair<const State, int>, std::allocator<std::pair<const State, int> >, std::__detail::_Select1st, std::equal_to<State>, ToHash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true> >::_M_find_node' requested here
      __node_type* __p = __h->_M_find_node(__n, __k, __code);
                              ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/unordered_map.h:973:16: note: in instantiation of member function 'std::__detail::_Map_base<State, std::pair<const State, int>, std::allocator<std::pair<const State, int> >, std::__detail::_Select1st, std::equal_to<State>, ToHash, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<true, false, true>, true>::operator[]' requested here
      { return _M_h[__k]; }
               ^
/in/sokoban.hpp:220:12: note: in instantiation of member function 'std::unordered_map<State, int, ToHash, std::equal_to<State>, std::allocator<std::pair<const State, int> > >::operator[]' requested here
    visited[Initial]=0;
           ^
/in/sokoban.hpp:74:10: note: candidate function not viable: 'this' argument has type 'const State', but method is not marked const
    bool operator==(const State& other){
         ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/postypes.h:216:5: note: candidate template ignored: could not match 'fpos<type-parameter-0-0>' against 'const State'
    operator==(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs)
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/stl_pair.h:448:5: note: candidate template ignored: could not match 'pair<type-parameter-0-0, type-parameter-0-1>' against 'const State'
    operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/stl_iterator.h:302:5: note: candidate template ignored: could not match 'reverse_iterator<type-parameter-0-0>' against 'const State'
    operator==(const reverse_iterator<_Iterator>& __x,
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/stl_iterator.h:340:5: note: candidate template ignored: could not match 'reverse_iterator<type-parameter-0-0>' against 'const State'
    operator==(const reverse_iterator<_IteratorL>& __x,
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/stl_iterator.h:1121:5: note: candidate template ignored: could not match 'move_iterator<type-parameter-0-0>' against 'const State'
    operator==(const move_iterator<_IteratorL>& __x,
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/stl_iterator.h:1127:5: note: candidate template ignored: could not match 'move_iterator<type-parameter-0-0>' against 'const State'
    operator==(const move_iterator<_Iterator>& __x,
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/allocator.h:146:5: note: candidate template ignored: could not match 'allocator<type-parameter-0-0>' against 'const State'
    operator==(const allocator<_T1>&, const allocator<_T2>&)
    ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/allocator.h:152:5: note: candidate template ignored: could not match 'allocator<type-parameter-0-0>' against 'const State'
    operator==(const allocator<_Tp>&, const allocator<_Tp>&)
    ^
8 errors generated.
/in/Compile/Makefile:16: recipe for target 'main' failed
make: *** [main] Error 1

Information

Submit By
Type
Submission
Homework
Project3
Language
C++
Submit At
2024-11-27 21:57:38
Judged At
2024-11-27 21:57:38
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes