The Fast Light Tool Kit ("FLTK", pronounced
"fulltick") is a cross-platform C++ GUI toolkit for
UNIX®/Linux® (X11), Microsoft® Windows®, and
MacOS® X. FLTK provides modern GUI functionality without the
bloat and supports 3D graphics via OpenGL® and its built-in
GLUT emulation. It was originally developed by Mr. Bill Spitzak
and is currently maintained by a small group of developers
across the world with a central repository in the US.
History of FLTK
It has always been Bill's belief that the GUI API of all
modern systems is much too high level. Toolkits (even FLTK) are
not what should be provided and documented as part of an
operating system. The system only has to provide arbitrary
shaped but featureless windows, a powerful set of graphics
drawing calls, and a simple unalterable method of
delivering events to the owners of the windows. NeXT (if you
ignored NextStep) provided this, but they chose to hide it and
tried to push their own baroque toolkit instead.
Many of the ideas in FLTK were developed on a NeXT (but
not using NextStep) in 1987 in a C toolkit Bill called
"views". Here he came up with passing events downward
in the tree and having the handle routine return a value
indicating whether it used the event, and the table-driven menus. In
general he was trying to prove that complex UI ideas could be
entirely implemented in a user space toolkit, with no knowledge
or support by the system.
After going to film school for a few years, Bill worked at
Sun Microsystems on the (doomed) NeWS project. Here he found an
even better and cleaner windowing system, and he reimplemented
"views" atop that. NeWS did have an unnecessarily
complex method of delivering events which hurt it. But the
designers did admit that perhaps the user could write just as
good of a button as they could, and officially exposed the lower
With the death of NeWS Bill realized that he would have to
live with X. The biggest problem with X is the "window
manager", which means that the toolkit can no longer
control the window borders or drag the window around.
At Digital Domain Bill discovered another toolkit,
"Forms". Forms was similar to his work, but provided
many more widgets, since it was used in many real applications,
rather then as theoretical work. He decided to use Forms, except
he integrated his table-driven menus into it. Several very large
programs were created using this version of Forms.
The need to switch to OpenGL and GLX, portability, and a
desire to use C++ subclassing required a rewrite of Forms.
This produced the first version of FLTK. The conversion to C++
required so many changes it made it impossible to recompile any
Forms objects. Since it was incompatible anyway, Bill decided
to incorporate his older ideas as much as possible by
simplifying the lower level interface and the event passing
Bill received permission to release it for free on the
Internet, with the GNU general public license. Response from
Internet users indicated that the Linux market dwarfed the SGI
and high-speed GL market, so he rewrote it to use X for all
drawing, greatly speeding it up on these machines. That is the
version you have now.
Digital Domain has since withdrawn support for FLTK. While
Bill is no longer able to actively develop it, he still
contributes to FLTK in his free time and is a part of the FLTK
FLTK was designed to be statically linked. This was done by
splitting it into many small objects and designing it so that
functions that are not used do not have pointers to them in the
parts that are used, and thus do not get linked in. This allows
you to make an easy-to-install program or to modify FLTK to
the exact requirements of your application without worrying
about bloat. FLTK works fine as a shared library, though, and
is now included with several Linux distributions.
Here are some of the core features unique to FLTK:
- sizeof(Fl_Widget) == 64 to 92.
- The "core" (the "hello" program
compiled & linked with a static FLTK library using
gcc on a 486 and then stripped) is 114K.
- The FLUID program (which includes every widget) is
- Written directly atop core libraries (Xlib, WIN32 or
Carbon) for maximum speed, and carefully optimized for
code size and performance.
- Precise low-level compatability between the X11,
WIN32 and MacOS versions - only about 10% of the code is
- Interactive user interface builder program. Output is
human-readable and editable C++ source code.
- Support for overlay hardware, with emulation if none
- Very small & fast portable 2-D drawing library
to hide Xlib, WIN32, or QuickDraw.
- OpenGL/Mesa drawing area widget.
- Support for OpenGL overlay hardware on both X11 and
WIN32, with emulation if none is available.
- Text widgets with Emacs key bindings, X cut &
paste, and foreign letter compose!
- Compatibility header file for the GLUT library.
- Compatibility header file for the XForms library.
FLTK comes with complete free source code. FLTK is available
under the terms of the GNU Library
General Public License with exceptions that allow for static
linking. Contrary to popular belief, it can be used in
commercial software - even Bill Gates could use it!
What Does "FLTK" Mean?
FLTK was originally designed to be compatible with the Forms
Library written for SGI machines. In that library all the
functions and structures started with "fl_". This
naming was extended to all new methods and widgets in the C++
library, and this prefix was taken as the name of the library.
It is almost impossible to search for "FL" on the
Internet, due to the fact that it is also the abbreviation for
Florida. After much debating and searching for a new name for
the toolkit, which was already in use by several people, Bill
came up with "FLTK", including a bogus excuse that it
stands for "The Fast Light Toolkit".
Building and Installing FLTK Under UNIX and MacOS X
In most cases you can just type "make". This will
run configure with the default of no options and then compile
FLTK uses GNU autoconf to configure itself for your UNIX
platform. The main things that the configure script will look
for are the X11 and OpenGL (or Mesa) header and library files.
If these cannot be found in the standard include/library
locations you'll need to define the CFLAGS,
CXXFLAGS, and LDFLAGS environment variables.
For the Bourne and Korn shells you'd use:
CFLAGS=-Iincludedir; export CFLAGS
CXXFLAGS=-Iincludedir; export CXXFLAGS
LDFLAGS=-Llibdir; export LDFLAGS
For C shell and tcsh, use:
setenv CFLAGS "-Iincludedir"
setenv CXXFLAGS "-Iincludedir"
setenv LDFLAGS "-Llibdir"
By default configure will look for a C++ compiler named
CC, c++, g++, or gcc in that
order. To use another compiler you need to set the CXX
CXX=xlC; export CXX
setenv CXX "xlC"
The CC environment variable can also be used to
override the default C compiler (cc or gcc),
which is used for a few FLTK source files.
You can run configure yourself to get the exact setup you
need. Type "./configure <options>", where
- Enable the Cygwin libraries under WIN32
- Enable debugging code & symbols
- Disable OpenGL support
- Enable generation of shared libraries
- Enable multithreading support
- Enable the X double-buffer extension
- Enable the Xft library for anti-aliased fonts under X11
- Set the location for executables [default = $prefix/bin]
- Set the location for data files. [default = $prefix/share]
- Set the location for libraries [default = $prefix/lib]
- Set the location for include files. [default = $prefix/include]
- Set the location for man pages. [default = $prefix/man]
- Set the directory prefix for files [default = /usr/local]
When the configure script is done you can just run the
"make" command. This will build the library, FLUID
tool, and all of the test programs.
To install the library, become root and type "make
install". This will copy the "fluid" executable
to "bindir", the header files to
"includedir", and the library files to
Building FLTK Under Microsoft Windows
There are three ways to build FLTK under Microsoft Windows.
The first is to use the Visual C++ 5.0 project files under the
"visualc" directory. Just open (or double-click on)
the "fltk.dsw" file to get the whole shebang.
The second method is to use the configure script
included with the FLTK software; this has only been tested with
the CygWin tools:
sh configure --prefix=C:/FLTK
The final method is to use a GNU-based development tool with
the files in the "makefiles" directory. To build
using one of these tools simply copy the appropriate
makeinclude and config files to the main directory and do a
copy makefiles\Makefile.<env> Makefile
Using the Visual C++ DLL Library
The "fltkdll.dsp" project file builds a DLL-version
of the FLTK library. Because of name mangling differences
between PC compilers (even between different versions of Visual
C++!) you can only use the DLL that is generated with the same
version compiler that you built it with.
When compiling an application or DLL that uses the FLTK DLL,
you will need to define the FL_DLL preprocessor symbol
to get the correct linkage commands embedded within the FLTK
Building FLTK Under OS/2
The current OS/2 build requires XFree86 for OS/2 to work. A
native Presentation Manager version has not been implemented
yet (volunteers are welcome!).
The current set of Makefiles/configuration failes assumes that
EMX 0.9d and libExt
To build the XFree86 version of FLTK for OS/2, copy the appropriate
makeinclude and config files to the main directory and do a make:
copy makefiles\Makefile.os2x Makefile
FLTK is available on the 'net in a bunch of locations:
[for reporting bugs]
- California, USA, (http://ftp.easysw.com)
- California, USA (ftp://ftp.easysw.com)
- Maryland, USA (ftp2.easysw.com)
- Espoo, Finland (ftp.funet.fi)
- Germany (linux.mathematik.tu-darmstadt.de)
- Austria (gd.tuwien.ac.at)
- firstname.lastname@example.org [see
- email@example.com [for
- NNTP Newsgroups
To send a message to the FLTK mailing list
("firstname.lastname@example.org") you must first join the list.
Non-member submissions are blocked to avoid problems with
To join the FLTK mailing list, send a message to
"email@example.com" with "subscribe fltk"
in the message body. A digest of this list is available by
subscribing to the "fltk-digest" mailing list.
To report a bug in FLTK, send an email to
"firstname.lastname@example.org". Please include the FLTK version,
operating system & version, and compiler that you are using
when describing the bug or problem. We will be unable to provide
any kind of help without that basic information.
Bugs can also be reported to the "fltk.bugs" newsgroup or on the
SourceForge bug tracker pages.
For general support and questions, please use the FLTK mailing list
at "email@example.com" or one of the newsgroups.
From Anonymous, 15:09 Feb 03, 2003 (score=5)
If you are compiling for a cygwin application that uses OpenGL, be sure to enable cygwin in the fltk make file:
[ Reply ]
From sparky, 09:17 Sep 01, 2005 (score=4)
To compile using Cygwin, I had to force use of local versions of the jpeg, zlib, and png libraries.
for example, when initially compiling FLTK 1.1.6 and FLUID type:
sh configure --prefix=C:/fltk-1.1.6 --enable-local-jpeg
I previosly had to undefine HAVE_LIBZ and HAVELIBJPEG in "config.h" to compile correctly in MS VC++ 6.0 with FLTK 1.1.5. This appears to have been fixed since FLTK 1.1.6.
[ Reply ]
From eng_ocoka, 14:55 Oct 12, 2005 (score=4)
I basically had the same problem in Cygwin. The make would not find the jpeg header, but the options I used were
./configure --prefix=/usr/local/fltk --enable-localjpeg --enable-localzlib --enable-localpng
(notice no hyphen on the localjpeg)
[ Reply ]
From kanze, 10:12 Oct 03, 2008 (score=3)
When building for several systems from a common source tree,
make distclean isn't sufficient; it leaves
some of the
.o files. I needed to do a
. -name '*.o' | xargs rm. (This is for Unix based
systems. I haven't tried to build it yet for Windows.)
[ Reply ]
From Anonymous, 15:01 Oct 21, 2004 (score=2)
MSYS from the MinGW site also worked with:
[ Reply ]
From Darius, 21:34 Nov 12, 2002 (score=2)
To compile against the DLL version of FLTK you also need to put fltkdll.lib in your Project->Settings->Link->Object/Library Modules list. (I found the file at fltk\test\fltkdll.lib)
[ Reply ]