How to compile SDL_bgi programs with Dev-C++

These instructions show how to compile an SDL_bgi program using Dev-C++; we will use fern.c, provided in the demo/ directory.

Let’s assume that Dev-C++ is installed in C:\Dev-Cpp, and that the SDL2 development libraries for MinGW are installed in C:\SDL2-*. If you installed the software in different directories, change the following instructions accordingly.

The procedure was tested with Orwell Dev-Cpp 5.11, TDM64-GCC 10.3.0, and SDL2-devel-2.24.2-mingw.tar.gz. Newer releases of these packages should work.

Links:

https://sourceforge.net/projects/orwelldevcpp/

https://libsdl.org/download-2.0.php

https://jmeubank.github.io/tdm-gcc/

Upgrading Dev-C++’s Compiler

By default, Dev-C++ ships with TDM-GCC 4.9.2; this is a very old version of gcc that is not compatible with current SDL2 development libraries. To compile SDL_bgi programs, you must upgrade TDM-GCC to a newer release.

Installing SDL_bgi

How to compile

Note 1: if you release your compiled program, you must also provide SDL2.dll and SDL_bgi.dll in the same directory.

Note 2: if your code uses functions provided by stdio.h (e.g. printf(), scanf(), etc.) you must also run a terminal. Remove the option -mwindows from the linker parameters.

Back to document index