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.
Introduction
FLTK supports most Unix and Linux platforms using CMake as the build system. This guide covers building FLTK on various Linux distributions and Unix systems including Debian, Ubuntu, Fedora, NetBSD, and more.Since FLTK 1.5.0, autotools and configure-based builds are no longer supported. You must use CMake.
Prerequisites
Required Packages
FLTK requires certain development packages to be installed. Choose the section for your distribution:- Debian/Ubuntu
- Fedora
- NetBSD
- Solaris/OpenIndiana
Install the core development tools and X11 libraries:
Optional but Recommended Packages
For Wayland support, see the Wayland platform guide.
Downloading FLTK
Download the latest stable release or development version:- Stable Release
- Git Development
Download from fltk.org/software.php:
Building FLTK
Quick Build
Build FLTK with default settings:Replace
Debug with Release for optimized production builds.Configuration Options
View available configuration options:-D CMAKE_BUILD_TYPE=Debug|Release- Build type-D CMAKE_INSTALL_PREFIX=/path- Installation directory-D FLTK_BUILD_SHARED_LIBS=ON- Build shared libraries-D FLTK_BUILD_EXAMPLES=ON- Build example programs
README.CMake.txt in the FLTK source directory.
Testing FLTK
Run the demo program to test the build:Installing FLTK
Install to the default location (/usr/local):
Building Your Applications
Using fltk-config
FLTK provides thefltk-config script to simplify compilation:
Using CMake
For larger projects, use CMake. Create aCMakeLists.txt:
IDE Integration
Code::Blocks
Install Code::Blocks IDE:- Select File > New > Project
- Choose FLTK project template
- Follow the wizard
- Go to Settings > Compiler and debugging settings > Other settings > Advanced options
- Add extension:
fl - Command line macro:
cd $file_dir; fluid -c $file - Generated files:
$file_dir/$file_name.cxxand$file_dir/$file_name.h
Platform Features
Display Backend
Linux FLTK supports both X11 and Wayland backends:- X11: Traditional X Window System (always available)
- Wayland: Modern display protocol (see Wayland guide)
Font Rendering
FLTK uses:- Xft: Anti-aliased font rendering (X11)
- Pango: Text rendering and international text support (Wayland)
Graphics
- Cairo: Vector graphics library (optional)
- OpenGL: Hardware-accelerated 3D graphics
Distribution Packages
Many distributions provide pre-built FLTK packages:- Debian/Ubuntu
- Fedora
- NetBSD
Troubleshooting
Missing Dependencies
If CMake reports missing dependencies, install the required development packages for your distribution.Symbol Font Issues
The Symbol and Zapf Dingbats fonts do not work on X11 UTF-8 platforms. This is expected behavior.Build Warnings
Theranlib tool may report modules with no symbols. This is normal and can be safely ignored.