Record Detail

Compile Error

In file included from /in/Compile/check.cpp:7:
/in/sokoban.hpp:35:58: error: use of undeclared identifier 'PATH'
    return isInBounds(x, y, rows, cols) && grid[y][x] == PATH;
                                                         ^
/in/sokoban.hpp:54:10: error: no member named 'queue' in namespace 'std'
    std::queue<std::tuple<int, int, std::vector<std::string>, std::string>> q; // (玩家x, 玩家y, 当前地图, 当前路径)
    ~~~~~^
/in/sokoban.hpp:54:75: error: expected '(' for function-style cast or type construction
    std::queue<std::tuple<int, int, std::vector<std::string>, std::string>> q; // (玩家x, 玩家y, 当前地图, 当前路径)
               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
/in/sokoban.hpp:54:77: error: use of undeclared identifier 'q'
    std::queue<std::tuple<int, int, std::vector<std::string>, std::string>> q; // (玩家x, 玩家y, 当前地图, 当前路径)
                                                                            ^
/in/sokoban.hpp:55:10: error: no template named 'unordered_set' in namespace 'std'; did you mean 'unordered_map'?
    std::unordered_set<std::string> visited; // 记录访问过的状态
    ~~~~~^~~~~~~~~~~~~
         unordered_map
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/unordered_map.h:101:11: note: 'unordered_map' declared here
    class unordered_map
          ^
In file included from /in/Compile/check.cpp:7:
/in/sokoban.hpp:55:10: error: too few template arguments for class template 'unordered_map'
    std::unordered_set<std::string> visited; // 记录访问过的状态
         ^
/usr/bin/../lib/gcc/x86_64-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/unordered_map.h:101:11: note: template is declared here
    class unordered_map
          ^
In file included from /in/Compile/check.cpp:7:
/in/sokoban.hpp:61:31: error: use of undeclared identifier 'START'
            if (grid[i][j] == START) {
                              ^
/in/sokoban.hpp:64:30: error: use of undeclared identifier 'PATH'
                grid[i][j] = PATH; // 将起始位置标记为路径
                             ^
/in/sokoban.hpp:70:5: error: use of undeclared identifier 'q'
    q.push({startX, startY, grid, ""});
    ^
/in/sokoban.hpp:71:82: error: use of undeclared identifier 'gridToState'
    visited.insert(std::to_string(startX) + "," + std::to_string(startY) + "," + gridToState(grid));
                                                                                 ^
/in/sokoban.hpp:73:13: error: use of undeclared identifier 'q'
    while (!q.empty()) {
            ^
/in/sokoban.hpp:74:53: error: use of undeclared identifier 'q'
        auto [playerX, playerY, currentMap, path] = q.front();
                                                    ^
/in/sokoban.hpp:75:9: error: use of undeclared identifier 'q'
        q.pop();
        ^
/in/sokoban.hpp:87:82: error: use of undeclared identifier 'WALL'; did you mean 'P_ALL'?
            if (!isInBounds(newX, newY, rows, cols) || currentMap[newY][newX] == WALL) {
                                                                                 ^~~~
                                                                                 P_ALL
/usr/include/x86_64-linux-gnu/bits/waitflags.h:54:3: note: 'P_ALL' declared here
  P_ALL,                /* Wait for any child.  */
  ^
In file included from /in/Compile/check.cpp:7:
/in/sokoban.hpp:91:43: error: use of undeclared identifier 'BOX'
            if (currentMap[newY][newX] == BOX) {
                                          ^
/in/sokoban.hpp:98:42: error: use of undeclared identifier 'PATH'
                    newMap[newY][newX] = PATH; // 玩家移动到箱子的位置
                                         ^
/in/sokoban.hpp:99:44: error: use of undeclared identifier 'BOX'
                    newMap[nextY][nextX] = BOX; // 箱子移动到新位置
                                           ^
/in/sokoban.hpp:100:48: error: use of undeclared identifier 'PATH'
                    newMap[playerY][playerX] = PATH; // 玩家原来的位置变回路径
                                               ^
/in/sokoban.hpp:102:104: error: use of undeclared identifier 'gridToState'
                    std::string newState = std::to_string(nextX) + "," + std::to_string(nextY) + "," + gridToState(newMap);
                                                                                                       ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 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-26 16:51:39
Judged At
2024-11-26 16:51:39
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes