Fazen2d ships with a Makefile that compiles allDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/adi3120/Fazen2d/llms.txt
Use this file to discover all available pages before exploring further.
.cpp files under include/ plus main.cpp into a single executable named a. The build system relies on g++ with the C++11 standard flag and GNU Make; no CMake, Ninja, or other meta-build tool is needed.
Using the Makefile
Open a terminal in the project root
Open
cmd.exe, PowerShell, or Git Bash and cd into the cloned Fazen2d/ directory — the folder that contains Makefile and main.cpp.Run make
Invoke the default Make discovers every
all target:*.cpp under include/ (geometry primitives, renderer, input handlers, console management, and utilities) plus main.cpp, compiles each into a corresponding .o object file inside include/, and links everything into the executable a.Run the executable
Launch the compiled demo directly from the project root:A white console buffer fills the window and an animated red box, blue line, and green circle appear. Press ESC to exit.
Makefile Internals
Below is the complete Makefile as it exists in the repository:| Variable | Value | Purpose |
|---|---|---|
CC | g++ | The compiler binary invoked for every compile and link step |
CFLAGS | -std=c++11 | Enables the C++11 standard required by Fazen2d’s type-safe APIs |
SRC_DIR | include | The directory scanned for *.cpp implementation files |
OBJ_DIR | include | Where object files are written (same directory as the sources) |
SRC_FILES | include/*.cpp + main.cpp | The full list of translation units fed to the compiler |
OBJ_FILES | include/*.o | Intermediate object files, one per source file |
TARGET | a | The name of the final linked executable |
$(OBJ_DIR)/%.o: $(SRC_DIR)/%.cpp compiles each source file individually. The final link rule gathers all .o files and passes them to g++ in one command.
Manual Compilation
If GNU Make is not available in your environment, you can compile and link everything in a singleg++ invocation:
include/*.cpp expands to every implementation file, and main.cpp provides the main() entry point. There is no separate clean step — simply delete a when needed.
Using run.bat
The repository includes a convenience batch script,run.bat, that chains the build, optional cleanup, and run steps in sequence. Its full contents are:
run.bat in File Explorer or call it from cmd.exe to build, clean object files, and confirm a successful link in one step. Note that in the current script the executable is not launched automatically after the cleanup — you still need to run .\a manually. The script is most useful as a CI-style smoke test to verify the project compiles cleanly from scratch.
Troubleshooting
make not found
make not found
GNU Make is not installed or not on your
PATH.- MSYS2:
pacman -S makeinside the MSYS2 shell, then addC:\msys64\usr\binto your WindowsPATH. - MinGW standalone: Download
mingw32-make.exe, rename it tomake.exe, and add its directory toPATH. - Chocolatey:
choco install makein an elevated PowerShell prompt.
make --version after installation.g++ not found
g++ not found
The
g++ compiler binary cannot be found on your PATH.Install MinGW-w64 via MSYS2 (pacman -S mingw-w64-ucrt-x86_64-gcc) or download a standalone MinGW distribution. Add the compiler’s bin folder (e.g., C:\msys64\ucrt64\bin) to your system PATH, then open a fresh terminal and verify with g++ --version.Spaces in the project path
Spaces in the project path
The Makefile uses bare path variables that are not quoted for spaces. If you have cloned the repository to a path such as
C:\My Projects\Fazen2d\, Make may misinterpret the space as an argument separator and fail with confusing errors.Fix: Clone or move the project to a path that contains no spaces, for example C:\dev\Fazen2d.Permission errors on del (make clean)
Permission errors on del (make clean)
The
clean target runs the Windows del command. In restricted environments (e.g., a networked drive, a folder with inherited read-only ACLs, or a corporate-managed machine) this can fail with an “Access is denied” error.Fix: Run your terminal as Administrator, or manually delete include\*.o from File Explorer.windows.h not found
windows.h not found
Fazen2d uses the Windows Console API (
WriteConsoleOutputW, GetAsyncKeyState, CHAR_INFO, etc.) declared in <windows.h>. This header is provided by the Windows SDK that is bundled with MinGW/MSYS2 and Visual Studio Build Tools.If the compiler cannot find windows.h, you are likely using a non-Windows GCC toolchain (e.g., a Linux g++ package). Fazen2d does not support Linux or macOS — it must be compiled with a Windows-targeted GCC or MSVC toolchain.