Skip to content

Instantly share code, notes, and snippets.

View CobaltXII's full-sized avatar

CobaltXII CobaltXII

View GitHub Profile
@CobaltXII
CobaltXII / cross_compiling_sdl2.md
Last active February 24, 2024 16:04
Cross-Compiling SDL2 Programs for Windows from Linux

Cross-Compiling SDL2 Programs for Windows from Linux

I'll explain how to create programs that run on Windows (.exe files) from a Linux machine. I'll explain how to compile C and C++, and how to make 32- and 64-bit programs. I'll also explain how to use third-party libraries (we'll use SDL2 here), and how to distribute the programs.

Installing and Using a Cross-Compiler

To cross-compile for another architecture, you first need to know what architecture you're compiling for. The important part here is the target triplet. It's typically in this format: