Video Companion:
https://www.youtube.com/watch?v=idU3fzh-COY
Update package database and packages with
pacman -Syu
in the msys2 shell. Note, you can right click to paste in the shell, normal ctrl+v wouldn't work.
Close and reopen the program
Run pacman -Su
Restart the program once more.
Next we need to start installing all the fancy things we need to run our program, including gcc, sfml, and ninja:
Open the msys2 shell (this is the MSYS 2 program, not powershell)
Run pacman -S base-devel
This will ask you to select between some packages. Ignore this (the default of "all" is correct) and hit enter to continue, then enter 'Y' to continue.
Run pacman -S mingw-w64-x86_64-gcc mingw-w64-x86_64-cmake mingw-w64-x86_64-ninja mingw-w64-x86_64-sfml mingw-w64-x86_64-gcc
Let's quickly go over what the packages installed do.
gcc
: A multi-language collection of compilers. A compiler takes higher level code like C, C++ and translates it, generally, to assembly code compatible with your hardware.
cmake
: Post below goes into detail.
Difference between using Makefile and CMake to compile the code
ninja
: A build system focused on speed, this replaces the need for the default Unix
's make
command. What's a build system? In short, on compile, only the modified code should be recompiled. But that's not enough. If you only change foo.hpp
, the files dependant on foo.hpp
also needs to be recompiled. In a build system, you can specify dependencies, with the final goal that your compiler output is valid and takes as little time as it needs.
sfml
: The rendering engine our game uses.
mingw
: Our of these packages prefixes with mingw-w64-x86_64
, w64
means windows 64
bits. x86_64
means the hardware uses the 64
bit version of the x86
instruction set.
Now let's modify the windows PATH variable.
C:\\msys64\\mingw64\\bin
to the PATH environment variable.