Skip to content

Instantly share code, notes, and snippets.

@donwilson
Last active December 9, 2015 19:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save donwilson/5b98296c9ce249ce22e1 to your computer and use it in GitHub Desktop.
Save donwilson/5b98296c9ce249ce22e1 to your computer and use it in GitHub Desktop.
Setup build batch file for SFML 2.3.2 (GCC 4.9.2 MinGW (DW2) - 32-bit) on Windows 10
@echo off
echo Initial cleanup
if exist files.tmp (
del files.tmp
)
if exist main.o (
del main.o
)
if exist main.exe (
del main.exe
)
echo Gathering source files
setlocal enabledelayedexpansion
for /r %%f in (*.cpp) do (
set a=%%f
set a=!a:\=/!
echo !a! >>files.tmp
)
endlocal
setlocal
set PATH=%PATH%;C:/dev_resources/mingw32-4.9.2/bin/;C:/dev_resources/SFML-2.3.2_GCC-4.9.2/bin/
echo Compiling
g++ -std=c++11 -c @files.tmp -IC:/dev_resources/SFML-2.3.2_GCC-4.9.2/include
echo Building
g++ main.o -std=c++11 -o main.exe -LC:/dev_resources/SFML-2.3.2_GCC-4.9.2/lib -lsfml-graphics -lsfml-window -lsfml-system
echo Running
main.exe
echo Cleanup
if exist files.tmp (
del files.tmp
)
if exist main.o (
del main.o
)
if exist main.exe (
del main.exe
)
echo Done
endlocal
1) Download GCC 4.9.2 MinGW (DW2) - 32-bit from http://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/4.9.2/threads-posix/dwarf/i686-4.9.2-release-posix-dwarf-rt_v3-rev0.7z/download (via http://stackoverflow.com/a/28011978)
- Extract to C:\dev_resources\mingw32-4.9.2
2) Download SFML 2.3.2 for GCC 4.9.2 MinGW (DW2) - 32-bit at http://www.sfml-dev.org/download/sfml/2.3.2/
- Extract to C:\dev_resources\SFML-2.3.2_GCC-4.9.2
3) Save compile.bat from this gist into your source directory where main.cpp is
4) (For now) copy "libstdc++-6.dll" from "C:\dev_resources\mingw32-4.9.2\bin\libstdc++-6.dll" into source directory where compile.bat is
5) Run compile.bat in CMD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment