garyo edited this page Dec 13, 2014 · 1 revision

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.

# SCons SConstruct file to build a typical SDL application on Windows with a windows icon using mingw

env = Environment(ENV=os.environ)

build_filename = 'appname'  # Will automatically add .exe extension
sources = [Glob('src/*.cpp'), env.RES('appname.rc')]  #Add window resource to include .ico file
libraries = ['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 window
env.Program(target = build_filename, source = sources, LIBS = libraries, LIBPATH = library_paths)


Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.