Building under Linux
Hey! I've seen your article at codeproject, very nice stuff! I'd like to build it up on Linux Ubuntu 22.04 but seems no any steps how to do it
I've seen some artifacts in the repository
- cmake
- makefile
the 2nd case failed, when I tried to directly feed makefile into make:
~/Downloads/chess_console/source make -f ./makefile
g++ -c -o main.o main.cpp
g++ -c -o user_interface.o user_interface.cpp
g++ -c -o chess.o chess.cpp
g++ -Wall -std=c++11 -o ../build/lnx/chess_console main.o user_interface.o chess.o
/bin/ld: cannot open output file ../build/lnx/chess_console: No such file or directory
collect2: error: ld returned 1 exit status
make: *** [makefile:13: chess] Error 1
the 1st case failed as well:
⎇ master ~/Downloads/chess_console/source cmake .
CMake Deprecation Warning at CMakeLists.txt:13 (cmake_minimum_required):
Compatibility with CMake < 3.5 will be removed from a future version of
CMake.
Update the VERSION argument <min> value or use a ...<max> suffix to tell
CMake that the project does not need compatibility with older versions.
-- The CXX compiler identification is GNU 11.4.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done (0.3s)
-- Generating done (0.0s)
-- Build files have been written to: /home/alex/Downloads/chess_console/source
⎇ master ?:4 ~/Downloads/chess_console/source make
g++ -c -o main.o main.cpp
g++ -c -o user_interface.o user_interface.cpp
g++ -c -o chess.o chess.cpp
g++ -Wall -std=c++11 -o ../build/lnx/chess_console main.o user_interface.o chess.o
/bin/ld: cannot open output file ../build/lnx/chess_console: No such file or directory
collect2: error: ld returned 1 exit status
make: *** [makefile:13: chess] Error 1
Please post some steps into readme regarding how to build it up under Linux!
@greenozon kindly try the steps below for building on linux
- get a copy of the repo. I can see you've done this already.
- assuming you cloned the repo into your home directory,
~/chess_console, continue below
- assuming you cloned the repo into your home directory,
cd ~/chess_console/sourcesmkdir buildcd buildcmake ..make- then you may run the game with
./chess
enjoy! :)
great news! thanks a lot for fast reply feel free to close this ticket
you are welcome @greenozon ; it may close automatically if the changes get merged
Thanks @fynnwilliam !
You are welcome @jeromevonk