This SConstruct file can be used as a simple template to build a SDL application in Windows. Uses MinWG and will need to be customized slightly to work with other compilers like Visual Studio's compiler.

This example includes a windows resource which links the executable to a .ico file and it uses the -mwindows flag so no annoying dialog window will appear when the application is started.

#!python # SCons SConstruct file to build a typical SDL application on Windows with a windows icon using mingwenv=Environment(ENV=os.environ)Tool('mingw')(env)build_filename='appname'# Will automatically add .exe extensionsources=[Glob('src/*.cpp'),env.RES('appname.rc')]#Add window resource to include .ico filelibraries=['mingw32','SDLmain','SDL','SDL_mixer','SDL_image','SDL_ttf']library_paths=['/MinGW/lib']env.MergeFlags('-mwindows')# Parse the -mwindows flag to remove the annoying console windowenv.Program(target=build_filename,source=sources,LIBS=libraries,LIBPATH=library_paths)