Gitea action trouble #1
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Так как разработка велась исключительно под Windows, то немудрено, что на Linux всё пошло через одно место (спасибо Actions). Поэтому необходимо пофиксить проблемы, выявленные на этапе сборки, а именно:
Добавить ifdef над _getch и заменить его UNIX-аналогом
Разобраться почему компилятор жалуется на std::max
Логи для понимания:
[ 25%] Building CXX object CMakeFiles/BattleCap.dir/src/BattleCap.cpp.o
[ 50%] Building CXX object CMakeFiles/BattleCap.dir/src/Game.cpp.o
/workspace/ParkSuMin/BattleCap/src/Game.cpp: In member function ‘void Game::info()’:
/workspace/ParkSuMin/BattleCap/src/Game.cpp:78:19: error: ‘_getch’ was not declared in this scope; did you mean ‘wgetch’?
78 | int key = _getch();
| ^~~~~~
| wgetch
/workspace/ParkSuMin/BattleCap/src/Game.cpp: In member function ‘void Game::init()’:
/workspace/ParkSuMin/BattleCap/src/Game.cpp:113:21: error: ‘_getch’ was not declared in this scope; did you mean ‘wgetch’?
113 | switch (_getch()) {
| ^~~~~~
| wgetch
/workspace/ParkSuMin/BattleCap/src/Game.cpp: In member function ‘void Game::play()’:
/workspace/ParkSuMin/BattleCap/src/Game.cpp:176:25: error: ‘_getch’ was not declared in this scope; did you mean ‘wgetch’?
176 | switch (_getch()) {
| ^~~~~~
| wgetch
/workspace/ParkSuMin/BattleCap/src/Game.cpp:216:25: error: ‘_getch’ was not declared in this scope; did you mean ‘wgetch’?
216 | switch (_getch()) {
| ^~~~~~
| wgetch
/workspace/ParkSuMin/BattleCap/src/Game.cpp:302:41: error: no matching function for call to ‘max()’
302 | const int max_val = std::max({ UP, DOWN, LEFT, RIGHT });
| ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/13/string:51,
from /workspace/ParkSuMin/BattleCap/include/Player.h:2,
from /workspace/ParkSuMin/BattleCap/include/Game.h:2,
from /workspace/ParkSuMin/BattleCap/src/Game.cpp:1:
/usr/include/c++/13/bits/stl_algobase.h:257:5: note: candidate: ‘template constexpr const _Tp& std::max(const _Tp&, const _Tp&)’
257 | max(const _Tp& __a, const _Tp& __b)
| ^~~
/usr/include/c++/13/bits/stl_algobase.h:257:5: note: template argument deduction/substitution failed:
/workspace/ParkSuMin/BattleCap/src/Game.cpp:302:41: note: candidate expects 2 arguments, 1 provided
302 | const int max_val = std::max({ UP, DOWN, LEFT, RIGHT });
| ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/13/bits/stl_algobase.h:303:5: note: candidate: ‘template<class _Tp, class _Compare> constexpr const _Tp& std::max(const _Tp&, const _Tp&, _Compare)’
303 | max(const _Tp& __a, const _Tp& __b, _Compare __comp)
| ^~~
/usr/include/c++/13/bits/stl_algobase.h:303:5: note: template argument deduction/substitution failed:
/workspace/ParkSuMin/BattleCap/src/Game.cpp:302:41: note: candidate expects 3 arguments, 1 provided
302 | const int max_val = std::max({ UP, DOWN, LEFT, RIGHT });
| ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
make[2]: *** [CMakeFiles/BattleCap.dir/build.make:90: CMakeFiles/BattleCap.dir/src/Game.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/BattleCap.dir/all] Error 2
make: *** [Makefile:91: all] Error 2
❌ Failure - Main Build project
exitcode '2': failure