chess_console icon indicating copy to clipboard operation
chess_console copied to clipboard

Building under Linux

Open greenozon opened this issue 1 year ago • 3 comments

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

  1. cmake
  2. 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 avatar Jun 06 '24 10:06 greenozon

@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
  • cd ~/chess_console/sources
  • mkdir build
  • cd build
  • cmake ..
  • make
  • then you may run the game with ./chess

enjoy! :)

fynnwilliam avatar Jun 06 '24 13:06 fynnwilliam

great news! thanks a lot for fast reply feel free to close this ticket

greenozon avatar Jun 06 '24 14:06 greenozon

you are welcome @greenozon ; it may close automatically if the changes get merged

fynnwilliam avatar Jun 07 '24 10:06 fynnwilliam

Thanks @fynnwilliam !

jeromevonk avatar Sep 18 '24 12:09 jeromevonk

You are welcome @jeromevonk

fynnwilliam avatar Sep 18 '24 16:09 fynnwilliam