Progmar Marcin Załęczny


How to compile linux sources in the windows

To compile cross-platform applications and libraries in Windows operating system you can use MSYS2 environment. It's installator can be downloaded from the website below:

After installation run the shell console and issue following command: pacman -Syuu
It updates and upgrades all packages.
After each upgarde you have to close the shell console by pressing close button on the top right of the window. (Do not do it by issuing "exit" command). Then run the shell console again and repeat steps above. Do it until no upgrade is available.

Install developers packages: pacman -S --needed base-devel mingw-w64-i686-toolchain mingw-w64-x86_64-toolchain git subversion mercurial mingw-w64-i686-cmake mingw-w64-x86_64-cmake

Display full names of querying libraries: pacman -Ss SDL2

Install package (specyfying it's full name): pacman -Sy mingw64/mingw-w64-x86_64-SDL2

Install additional game-dev libraries: pacman -Sy mingw64/mingw-w64-x86_64-SDL2_image
pacman -Sy mingw64/mingw-w64-x86_64-SDL2_ttf
pacman -Sy mingw64/mingw-w64-x86_64-SDL2_mixer

Install GLEW library: pacman -Sy mingw64/mingw-w64-x86_64-glew

Compile opengl and SDL2 application: gcc -o snow snow.c ../render_text.c ../shaders.c ../utils_graphics.c -lmingw32 -lSDL2main -lSDL2 -lSDL2_image -lopengl32 -lglu32 -lglew32 -lm