Modern compilers (64-bit) are incompatible with Turbo C (16-bit DOS-based). As a result, old graphics programs cannot run or compile. We must either use outdated tools or upgrade to a modern development environment.
Why we use modern tools instead of Turbo C
MSYS2 → Linux-like development environment for Windows
MSYS2 UCRT64 → Terminal where all commands are executed
SDL3 → Graphics rendering engine
SDL3_bgi → Enables graphics.h support
graphics.h → Used in C graphics programs
GCC / Clang → Compilers
SDL3_bgi.dll → Required runtime file for execution
Step 3.0: Download & Install MSYS2
From official MSYS2 website.
Step 3.1: Open MSYS2 UCRT64 Shell
Search in Windows:
Step 3.2: Update system
| pacman | MSYS2 package manager |
| -Syu | Update system + packages |
Step 3.3: Install SDL3
Step 3.4: Install Clang
Step 3.5: Download SDL3_bgi (ZIP)
From official website. Extract it anywhere (Desktop / Downloads)
/your-folder/ → replace it with your actual extracted path./c/Users/YourName/Downloads/SDL3_bgi
Step 3.6: Copy files
| cp | Copy command |
| /ucrt64/include | Header files location |
| /ucrt64/bin | DLL runtime location |
Step 3.7: Go to SDL3_bgi folder
| cd | Change directory (move into folder) |
Step 3.8: Compile library
| clang | Compiler |
| -c | Compile only (no exe) |
| .c | Source file |
| .o | Object file |
Step 3.9: Create library
| ar | Archive tool |
| rcs | Create static library |
Step 3.10: Copy library
Step 4.0: Go to project folder
| cd | Change directory (move into folder) |
| /e/... | Your drive path in MSYS2 |
Step 4.1: Compile program
| gcc | Compiler |
| main.c | Source code file |
| -o line.exe | Output executable name |
| -lSDL3_bgi | Graphics library |
| -lSDL3 | SDL3 engine |
| -lm | Math library |
Step 4.2: Run program