Documentation Index
Fetch the complete documentation index at: https://mintlify.com/fltk/fltk/llms.txt
Use this file to discover all available pages before exploring further.
Installation
FLTK 1.5 uses CMake exclusively as its build system. CMake generates platform-specific build files (Makefiles, Visual Studio projects, Xcode projects) from a single configuration.Prerequisites
Before building FLTK, ensure you have:CMake 3.15 or later
C++11 capable compiler
FLTK 1.5 requires C++11 support:
- Linux: GCC 4.8+, Clang 3.3+
- Windows: Visual Studio 2015+, MinGW-w64
- macOS: Xcode 7.0+ (Apple Clang)
Platform dependencies
- Linux
- Windows
- macOS
Install development packages for X11, OpenGL, and optional libraries:Ubuntu/Debian:Fedora/RHEL:For Wayland support (optional):
Building FLTK
FLTK supports out-of-tree builds. The source directory remains clean, and you can maintain multiple build configurations.Quick build (all platforms)
Build options
Customize your FLTK build with CMake options:Common options
Build type options
Build type options
CMAKE_BUILD_TYPE: Controls optimization and debug symbols
Release: Optimized, no debug info (default for single-config generators)Debug: No optimization, full debug symbolsRelWithDebInfo: Optimized with debug symbolsMinSizeRel: Optimize for size
Library options
Library options
FLTK_BUILD_SHARED_LIBS: Build shared libraries in addition to static (default: OFF)FLTK_BUILD_GL: Build OpenGL support library (default: ON)FLTK_BUILD_FORMS: Build (X)Forms compatibility library (default: OFF)FLTK_BUILD_EXAMPLES: Build example programs (default: OFF)FLTK_BUILD_TEST: Build test and demo programs (default: ON)
Platform-specific options
Platform-specific options
Linux/Unix:
FLTK_BACKEND_WAYLAND: Enable Wayland backend (default: ON)FLTK_BACKEND_X11: Enable X11 backend (default: ON)FLTK_GRAPHICS_CAIRO: Use Cairo for graphics (default: ON with Wayland)FLTK_USE_PANGO: Use Pango for text rendering (default: ON with Cairo)
FLTK_GRAPHICS_GDIPLUS: Use GDI+ for antialiasing (default: ON)FLTK_MSVC_RUNTIME_DLL: Use DLL runtime with MSVC (default: ON)
CMAKE_OSX_ARCHITECTURES: “arm64”, “x86_64”, or “arm64;x86_64” for universalCMAKE_OSX_DEPLOYMENT_TARGET: Minimum macOS version (e.g., “11.0”)
Advanced options
Advanced options
FLTK_OPTION_SVG: SVG support (default: ON)FLTK_OPTION_LARGE_FILE: Large file support >2GB (default: ON)FLTK_USE_SYSTEM_LIBJPEG: Use system libjpeg instead of bundled (default: ON on Linux, OFF on Windows/macOS)FLTK_USE_SYSTEM_LIBPNG: Use system libpng instead of bundled (default: same as libjpeg)FLTK_USE_SYSTEM_ZLIB: Use system zlib instead of bundled (default: same as libjpeg)
Platform-specific builds
- Linux Makefiles
- Windows Visual Studio
- Windows MinGW
- macOS Xcode
Standard build with Unix Makefiles:For a Debug build in a separate directory:
Verify installation
After building, verify FLTK is working:Building without installation
You can develop FLTK applications without system-wide installation:- Testing different FLTK versions
- Development without sudo privileges
- Keeping multiple FLTK configurations
Troubleshooting
CMake can't find compiler
CMake can't find compiler
Ensure your compiler is in PATH:For Visual Studio, use “Developer Command Prompt for VS”.
Missing X11 headers on Linux
Missing X11 headers on Linux
OpenGL not found
OpenGL not found
Build fails on Windows with MinGW
Build fails on Windows with MinGW
Use MSYS2 environment, not standalone MinGW:
Next steps
Quick start
Build your first FLTK application
Hello world tutorial
Detailed walkthrough of a simple program