2010-11-14 19:37:34 +03:00
|
|
|
README.Unix.txt - 2010-11-14 - Building FLTK on Unix
|
2010-10-28 18:13:01 +04:00
|
|
|
-----------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CONTENTS
|
|
|
|
==========
|
|
|
|
|
|
|
|
1 INTRODUCTION
|
|
|
|
2 PREREQUISITES
|
|
|
|
2.1 Ubuntu 10
|
2010-10-30 18:51:32 +04:00
|
|
|
2.2 Linux Mint 9
|
|
|
|
2.3 Fedora 13
|
2010-10-28 18:49:12 +04:00
|
|
|
2.4 * http://www2.mandriva.com/
|
|
|
|
2.5 * http://www.opensuse.org/en/
|
|
|
|
2.6 * http://www.debian.org/
|
|
|
|
2.7 * Mandrake?
|
2013-09-24 01:01:05 +04:00
|
|
|
2.8 SunOS / Solaris
|
2010-10-28 18:49:12 +04:00
|
|
|
2.9 * SGI?
|
2013-09-24 01:01:05 +04:00
|
|
|
2.10 HP-UX
|
|
|
|
2.11 AIX
|
|
|
|
2.12 NetBSD
|
2010-10-28 18:13:01 +04:00
|
|
|
3 HOW TO BUILD FLTK USING GCC
|
|
|
|
3.1 Prerequisites
|
|
|
|
3.2 Downloading and Unpacking
|
|
|
|
3.3 Configuring FLTK
|
|
|
|
3.4 Building FLTK
|
|
|
|
3.5 Testing FLTK
|
|
|
|
3.6 Installing FLTK
|
|
|
|
3.7 Creating new Projects
|
2010-10-30 22:21:40 +04:00
|
|
|
4 CREATING A NEW PROJECT IN CODE::BLOCKS
|
2010-10-30 18:51:32 +04:00
|
|
|
5 DOCUMENT HISTORY
|
2010-10-28 18:13:01 +04:00
|
|
|
|
2010-10-30 18:51:32 +04:00
|
|
|
* TODO: we still need to write these chapters
|
2010-10-28 18:13:01 +04:00
|
|
|
|
2010-10-30 18:51:32 +04:00
|
|
|
|
2010-10-30 20:50:44 +04:00
|
|
|
|
2010-10-30 18:51:32 +04:00
|
|
|
1 INTRODUCTION
|
|
|
|
=================
|
2010-10-28 18:13:01 +04:00
|
|
|
|
2016-08-01 15:50:15 +03:00
|
|
|
FLTK currently supports the following development environments on most Unix
|
2010-10-28 18:13:01 +04:00
|
|
|
platforms:
|
|
|
|
|
|
|
|
- gcc command line tools
|
|
|
|
- Code::Blocks
|
|
|
|
- ...
|
|
|
|
|
2010-10-30 20:50:44 +04:00
|
|
|
The Symbol font and the Zapf Dingbats font do not work on X11. This is correct
|
|
|
|
behavior for UTF-8 platforms.
|
|
|
|
|
|
|
|
|
2010-10-28 18:13:01 +04:00
|
|
|
|
2010-10-30 18:51:32 +04:00
|
|
|
2 PREREQUISITES
|
|
|
|
==================
|
2010-10-28 18:13:01 +04:00
|
|
|
|
|
|
|
|
2010-10-30 18:51:32 +04:00
|
|
|
2.1 Ubuntu 10
|
|
|
|
----------------
|
2010-10-28 18:13:01 +04:00
|
|
|
|
|
|
|
Ubuntu Linux can be downloaded here:
|
|
|
|
|
2010-10-30 18:51:32 +04:00
|
|
|
http://www.ubuntu.com/
|
2010-10-28 18:13:01 +04:00
|
|
|
|
|
|
|
If you have not done so yet, download and install Ubuntu.
|
|
|
|
|
|
|
|
Open a shell and install some software:
|
|
|
|
|
|
|
|
sudo apt-get install g++
|
|
|
|
sudo apt-get install gdb
|
|
|
|
sudo apt-get install subversion
|
|
|
|
sudo apt-get install autoconf
|
|
|
|
sudo apt-get install libx11-dev
|
|
|
|
sudo apt-get install libglu1-mesa-dev
|
2010-10-30 18:51:32 +04:00
|
|
|
|
|
|
|
These two are optional, but highly recommended:
|
|
|
|
|
2010-10-28 18:13:01 +04:00
|
|
|
sudo apt-get install libasound2-dev
|
|
|
|
sudo apt-get install libxft-dev
|
|
|
|
|
|
|
|
If you are planning to use the Code::Blocks IDE, also install this
|
|
|
|
|
|
|
|
sudo apt-get install codeblocks
|
|
|
|
|
|
|
|
I like to use subversion to install the latest FLTK-1.3.release:
|
|
|
|
|
2013-09-24 01:01:05 +04:00
|
|
|
svn co http://seriss.com/public/fltk/fltk/branches/branch-1.3/ fltk-1.3
|
2010-10-28 18:13:01 +04:00
|
|
|
|
|
|
|
To update to the latest version, just go into the fltk-1.3 directory and type
|
|
|
|
|
|
|
|
svn update
|
|
|
|
|
|
|
|
|
2010-10-30 18:51:32 +04:00
|
|
|
2.2 Linux Mint 9
|
|
|
|
-------------------
|
|
|
|
|
|
|
|
Linux Mint 9 can be downloaded here:
|
|
|
|
|
|
|
|
http://www.linuxmint.com/
|
|
|
|
|
|
|
|
If you have not done so yet, download and install Linux Mint.
|
|
|
|
|
|
|
|
Open a shell and install some software:
|
|
|
|
|
|
|
|
sudo apt-get install g++
|
|
|
|
sudo apt-get install gdb
|
|
|
|
sudo apt-get install subversion
|
|
|
|
sudo apt-get install autoconf
|
|
|
|
sudo apt-get install libx11-dev
|
|
|
|
sudo apt-get install libglu1-mesa-dev
|
|
|
|
|
|
|
|
These two are optional, but highly recommended:
|
|
|
|
|
|
|
|
sudo apt-get install libasound2-dev
|
|
|
|
sudo apt-get install libxft-dev
|
|
|
|
|
|
|
|
If you are planning to use the Code::Blocks IDE, also install this
|
|
|
|
|
|
|
|
sudo apt-get install codeblocks
|
|
|
|
|
|
|
|
I like to use subversion to install the latest FLTK-1.3.release:
|
|
|
|
|
2013-09-24 01:01:05 +04:00
|
|
|
svn co http://seriss.com/public/fltk/fltk/branches/branch-1.3/ fltk-1.3
|
2010-10-30 18:51:32 +04:00
|
|
|
|
|
|
|
To update to the latest version, just go into the fltk-1.3 directory and type
|
2010-10-28 18:13:01 +04:00
|
|
|
|
2010-10-30 18:51:32 +04:00
|
|
|
svn update
|
2010-10-28 18:13:01 +04:00
|
|
|
|
2010-10-30 18:51:32 +04:00
|
|
|
FIXME: no FL_SYMBOL font (-*-symbol-*), font 15 (Zapf-Dingbats)
|
2010-10-28 18:13:01 +04:00
|
|
|
|
2010-10-30 18:51:32 +04:00
|
|
|
|
|
|
|
2.3 Fedora 13
|
|
|
|
-------------------
|
|
|
|
|
|
|
|
Fedora 13 Linux can be downloaded here:
|
|
|
|
|
|
|
|
http://fedoraproject.org/
|
|
|
|
|
|
|
|
If you have not done so yet, download and install Fedora.
|
|
|
|
|
|
|
|
Open a terminal window and install some software. In Fedora, the default user
|
|
|
|
has no permission to call "sudo", so we will change user a few times:
|
|
|
|
|
|
|
|
su root
|
|
|
|
yum groupinstall "Development Tools"
|
|
|
|
yum groupinstall "X Software Development"
|
2016-01-19 03:46:54 +03:00
|
|
|
yum groupinstall "C Development Tools and Libraries"
|
2010-10-30 18:51:32 +04:00
|
|
|
|
|
|
|
If you are planning to use the Code::Blocks IDE, also install this
|
|
|
|
|
|
|
|
yum install codeblocks.i686 (for 64 bit machines)
|
|
|
|
|
|
|
|
Don't forget to leave root status (Ctrl-D) before loading FLTK. To install FLTK
|
|
|
|
for every user, you either have to set root user again, or use "visudo" to add
|
|
|
|
yourself to the "sudo" list.
|
|
|
|
|
|
|
|
I like to use subversion to install the latest FLTK-1.3.release:
|
|
|
|
|
2013-09-24 01:01:05 +04:00
|
|
|
svn co http://seriss.com/public/fltk/fltk/branches/branch-1.3/ fltk-1.3
|
2010-10-30 18:51:32 +04:00
|
|
|
|
|
|
|
To update to the latest version, just go into the fltk-1.3 directory and type
|
|
|
|
|
|
|
|
svn update
|
|
|
|
|
|
|
|
FIXME: no FL_SYMBOL font (-*-symbol-*), font 15 (Zapf-Dingbats)
|
|
|
|
|
|
|
|
|
2013-09-24 01:01:05 +04:00
|
|
|
2.8 SunOS / Solaris
|
|
|
|
----------------------
|
|
|
|
|
|
|
|
SunOS is a commercial operating system from Sun Microsystems (in 2009 the
|
|
|
|
company was sold to Oracle). SunOS is also called Solaris since version 5.
|
|
|
|
There was an open source derivative called OpenSolaris (based on Solaris 10)
|
|
|
|
that was cancelled by Oracle. The successor in spirit is called OpenIndiana
|
|
|
|
and can be downloaded from here:
|
|
|
|
|
|
|
|
http://www.openindiana.org/
|
|
|
|
|
|
|
|
For FLTK you need at least SunOS 5.7 (aka Solaris 7). This version supports
|
|
|
|
64 bit machines and POSIX threads. For machines with 64 bit SPARC processors
|
|
|
|
it is highly recommended to use Sun compilers, the 64 bit code generated by
|
|
|
|
older versions of GCC for such machines is unusable (expect something between
|
|
|
|
horribly broken and immediate crash).
|
|
|
|
|
|
|
|
Consider using pkgsrc with this operating system. See the NetBSD section if
|
|
|
|
you want to do so.
|
|
|
|
If you have GCC and Sun compilers installed, configure your environment like
|
|
|
|
this to use the Sun compilers and pkgsrc graphics libraries:
|
|
|
|
|
|
|
|
export CC="cc"
|
|
|
|
export CXX="CC"
|
|
|
|
export CPPFLAGS="-I/usr/pkg/include"
|
|
|
|
export LDFLAGS="-L/usr/pkg/lib -R/usr/pkg/lib"
|
|
|
|
|
|
|
|
To build a 64 bit FLTK library, add the following flags:
|
|
|
|
|
|
|
|
export CFLAGS="-xarch=v9"
|
|
|
|
export CXXFLAGS="-xarch=v9"
|
|
|
|
|
|
|
|
|
|
|
|
2.10 HP-UX
|
|
|
|
-------------
|
|
|
|
|
|
|
|
HP-UX is a commercial operating system from HP, no free or open source
|
|
|
|
derivatives are available.
|
|
|
|
|
|
|
|
For FLTK you need at least HP-UX 11.11 and the latest patch bundles should be
|
|
|
|
installed.
|
|
|
|
|
|
|
|
Consider using pkgsrc with this operating system. See the NetBSD section if
|
|
|
|
you want to do so.
|
|
|
|
|
|
|
|
|
|
|
|
2.11 AIX
|
|
|
|
-----------
|
|
|
|
|
|
|
|
AIX is a commercial operating system from IBM, no free or open source
|
|
|
|
derivatives are available.
|
|
|
|
|
|
|
|
For FLTK you need at least AIX 5L, I have tested version 5.1 patched to ML9.
|
|
|
|
|
|
|
|
Consider using pkgsrc with this operating system. See the NetBSD section if
|
|
|
|
you want to do so.
|
|
|
|
|
|
|
|
|
|
|
|
2.12 NetBSD
|
|
|
|
--------------
|
|
|
|
|
|
|
|
NetBSD can be downloaded here:
|
|
|
|
|
|
|
|
http://www.netbsd.org/
|
|
|
|
|
|
|
|
If you have not done so yet, download and install NetBSD. Ensure that the
|
|
|
|
optional distribution sets "comp" (Compiler, header files, development tools)
|
|
|
|
and x*** (X Window System) are installed.
|
|
|
|
|
|
|
|
Now install and configure pkgsrc. The current version can be downloaded here:
|
|
|
|
|
|
|
|
http://www.pkgsrc.org/
|
|
|
|
|
|
|
|
To use the current stable version of FLTK, simply install it from pkgsrc:
|
|
|
|
|
|
|
|
cd /usr/pkgsrc/x11/fltk13
|
|
|
|
bmake install
|
|
|
|
|
|
|
|
For the latest development snapshot, first install the svn client from pkgsrc:
|
|
|
|
|
|
|
|
cd /usr/pkgsrc/devel/subversion
|
|
|
|
bmake install
|
|
|
|
|
|
|
|
Now fetch the latest FLTK source code:
|
|
|
|
|
|
|
|
svn co http://seriss.com/public/fltk/fltk/branches/branch-1.3/ fltk-1.3
|
|
|
|
|
|
|
|
To update to the latest version, just go into the fltk-1.3 directory and type
|
|
|
|
|
|
|
|
svn update
|
|
|
|
|
|
|
|
If you have installed JPEG and PNG libraries from pkgsrc, configure your
|
|
|
|
environment as follows so that the FLTK configure script can find them:
|
|
|
|
|
|
|
|
export CPPFLAGS="-I/usr/pkg/include"
|
|
|
|
export LDFLAGS="-L/usr/pkg/lib"
|
|
|
|
|
|
|
|
To install GNU autoconf from pkgsrc:
|
|
|
|
|
|
|
|
cd /usr/pkgsrc/devel/autoconf
|
|
|
|
bmake install
|
|
|
|
|
2010-10-30 18:51:32 +04:00
|
|
|
|
|
|
|
3 HOW TO BUILD FLTK USING GCC
|
|
|
|
================================
|
|
|
|
|
|
|
|
|
|
|
|
3.1 Downloading and Unpacking
|
|
|
|
--------------------------------
|
2010-10-28 18:13:01 +04:00
|
|
|
|
|
|
|
Download FLTK from here:
|
|
|
|
|
|
|
|
http://www.fltk.org/software.php
|
|
|
|
|
|
|
|
If you are familiar with "subversion" and like to stay current with your
|
|
|
|
version, you will find the subversion access parameters at the bottom of that
|
2010-12-23 12:49:57 +03:00
|
|
|
page. Unpack FLTK into a convenient location. I like to have everything in my
|
2010-10-28 18:13:01 +04:00
|
|
|
dev directory:
|
|
|
|
|
|
|
|
cd
|
|
|
|
mkdir dev
|
|
|
|
cd dev
|
|
|
|
mv ~/Downloads/fltk-1.3.xxxx.tar.gz .
|
|
|
|
tar xvfz fltk-1.3.xxxx.tar.gz
|
|
|
|
cd fltk-1.3.xxxx
|
|
|
|
|
|
|
|
|
2010-10-30 18:51:32 +04:00
|
|
|
3.2 Configuring FLTK
|
|
|
|
-----------------------
|
2010-10-28 18:13:01 +04:00
|
|
|
|
2013-12-13 14:19:54 +04:00
|
|
|
If you got FLTK via subversion then you need one extra step. Otherwise skip
|
|
|
|
over this part. Stay in your FLTK source-code directory and type the
|
|
|
|
following:
|
|
|
|
|
|
|
|
NOCONFIGURE=1 ./autogen.sh
|
2010-10-28 18:13:01 +04:00
|
|
|
|
|
|
|
Now configure your FLTK installation:
|
|
|
|
|
|
|
|
./configure
|
|
|
|
|
|
|
|
ADVANCED: type "./configure --help" to get a complete list of optional
|
2016-08-01 15:50:15 +03:00
|
|
|
configuration parameters. These should be pretty self-explanatory. Some
|
2010-10-28 18:13:01 +04:00
|
|
|
more details can be found in README.
|
|
|
|
:END_ADVANCED
|
|
|
|
|
|
|
|
The configuration script will check your machine for the required resources
|
2016-08-01 15:50:15 +03:00
|
|
|
which you should have installed as described in the Prerequisites chapter.
|
|
|
|
Review the Configuration Summary, maybe take some notes.
|
2010-10-28 18:13:01 +04:00
|
|
|
|
|
|
|
|
2010-10-30 18:51:32 +04:00
|
|
|
3.3 Building FLTK
|
|
|
|
--------------------
|
2010-10-28 18:13:01 +04:00
|
|
|
|
|
|
|
Now this is easy. Stay in your FLTK source-code directory and type:
|
|
|
|
|
|
|
|
make
|
|
|
|
|
|
|
|
The entire FLTK toolkit including many test programs will be built for you. No
|
|
|
|
warnings should appear. If some do, please let the FLTK developer team know via
|
|
|
|
the mailing list or the bug reporting template at www.fltk.org .
|
|
|
|
|
2016-08-01 15:50:15 +03:00
|
|
|
Actually, as of Apr 13 2016, one or two warnings will show, mostly about
|
|
|
|
deprecated declarations. Please ignore them.
|
2010-10-28 18:13:01 +04:00
|
|
|
|
|
|
|
|
2010-10-30 18:51:32 +04:00
|
|
|
3.4 Testing FLTK
|
|
|
|
-------------------
|
2010-10-28 18:13:01 +04:00
|
|
|
|
|
|
|
After a successful build, you can test FLTK's capabilities:
|
|
|
|
|
|
|
|
test/demo
|
|
|
|
|
|
|
|
|
2010-10-30 18:51:32 +04:00
|
|
|
3.5 Installing FLTK
|
|
|
|
----------------------
|
2010-10-28 18:13:01 +04:00
|
|
|
|
|
|
|
If you did not change any of the configuration settings, FLTK will be installed
|
|
|
|
in "/usr/local/include" and "/usr/local/lib" by typing
|
|
|
|
|
|
|
|
sudo make install
|
|
|
|
|
2010-11-14 19:37:34 +03:00
|
|
|
If you are using the KDE, GNOME or XFCE desktop environments and want to call
|
|
|
|
"fluid" from the desktop menu, you will need to install additional files and
|
|
|
|
icons under "/usr/share" by typing:
|
|
|
|
|
|
|
|
sudo make install-desktop
|
|
|
|
|
2010-12-23 12:49:57 +03:00
|
|
|
It is possible to install FLTK without superuser privileges by changing the
|
2010-10-28 18:13:01 +04:00
|
|
|
installation path to a location within the user account by adding the
|
|
|
|
"--prefix=PREFIX" parameters to the "./configure" command.
|
|
|
|
|
|
|
|
|
2010-10-30 18:51:32 +04:00
|
|
|
3.6 Creating new Projects
|
|
|
|
----------------------------
|
2010-10-28 18:13:01 +04:00
|
|
|
|
2016-08-01 15:50:15 +03:00
|
|
|
FLTK provides a neat script named "fltk-config" that can provide all the flags
|
2010-10-28 18:13:01 +04:00
|
|
|
needed to build FLTK applications using the same flags that were used to build
|
|
|
|
the library itself. Running "fltk-config" without arguments will print a list
|
2016-08-01 15:50:15 +03:00
|
|
|
of options. The easiest call to compile an FLTK application from a single
|
|
|
|
source file is:
|
2010-10-28 18:13:01 +04:00
|
|
|
|
|
|
|
fltk-config --compile myProgram.cxx
|
|
|
|
|
|
|
|
"fltk-config" and "fluid" will be installed in "/usr/local/bin/" by default. I
|
|
|
|
recommend that you add it to the command search path.
|
|
|
|
|
|
|
|
|
|
|
|
|
2010-10-30 22:21:40 +04:00
|
|
|
4 CREATING A NEW PROJECT IN CODE::BLOCKS
|
|
|
|
===========================================
|
|
|
|
|
|
|
|
Code::Blocks is a free and popular C++ IDE in the Linux world. It also runs on
|
|
|
|
OS X and MSWindows. Configured correctly, it can also cross-compile between
|
2010-12-23 12:49:57 +03:00
|
|
|
these platforms. This chapter focuses on creating a new FLTK project for Linux,
|
2010-10-30 22:21:40 +04:00
|
|
|
assuming that FLTK 1.3 was previously built and installed in its default
|
|
|
|
location from the command line.
|
|
|
|
|
|
|
|
If not done yet, install Code::Blocks as described in the Prerequisites chapter
|
|
|
|
above, or download it from their web site. This description is based on
|
|
|
|
version 10.05:
|
|
|
|
|
|
|
|
http://www.codeblocks.org/
|
|
|
|
|
|
|
|
Start Code::Blocks. Select File > New > Project. In the "New from template"
|
|
|
|
dialog box, click on "FLTK project" and follow the instructions.
|
|
|
|
|
2016-08-01 15:50:15 +03:00
|
|
|
The default project supports basic fltk. If you would like to add support for
|
2010-10-30 22:21:40 +04:00
|
|
|
images, OpenGL, GLUT, or Forms, add the corresponding flags --use-images,
|
|
|
|
--use-gl, --use-glut, and --use-forms respectively.
|
|
|
|
|
2016-08-01 15:50:15 +03:00
|
|
|
The flags are located in the "Project Build Options" dialog. To change the
|
2010-10-30 22:21:40 +04:00
|
|
|
compiler flags, select your project in the tree view, then select the
|
2016-08-01 15:50:15 +03:00
|
|
|
"Compiler Settings" tab, then "Other Options" and add the flags to
|
|
|
|
`fltk-config --cxxflags` in front of the second "`".
|
2010-10-30 22:21:40 +04:00
|
|
|
|
|
|
|
The linker flags are located in the "Linker Settings" tab under "Other Linker
|
|
|
|
Options". Add the flags to `fltk-config --ldstaticflags` in front of the
|
|
|
|
second "`".
|
2010-10-30 18:51:32 +04:00
|
|
|
|
2016-08-01 15:50:15 +03:00
|
|
|
CodeBlocks can be set up to use fluid to manage modules.
|
2013-06-17 22:41:38 +04:00
|
|
|
The following info is from mingodad@gmail.com posted on fltk.general 06/17/2013:
|
|
|
|
|
|
|
|
"""
|
2013-06-17 23:23:49 +04:00
|
|
|
I have these settings in codeblocks on linux:
|
2013-06-17 22:41:38 +04:00
|
|
|
|
|
|
|
Settings ->
|
|
|
|
Compiler and debugging settings ->
|
|
|
|
Other settings ->
|
|
|
|
Advanced options:
|
|
|
|
|
|
|
|
-- Add an extension (in my case "fl")
|
|
|
|
|
|
|
|
-- On command line macro:
|
|
|
|
cd $file_dir; fluid -c $file
|
|
|
|
|
|
|
|
-- Generated files (to be further compiled):
|
|
|
|
$file_dir/$file_name.cxx
|
|
|
|
$file_dir/$file_name.h
|
|
|
|
|
|
|
|
Settings -> Environment -> Files extension handling :
|
|
|
|
Wildcard : *.fl
|
|
|
|
To open file: Launch an external program
|
|
|
|
External program: fluid
|
|
|
|
|
|
|
|
With that I can double click on any fluid file I include on a project
|
2013-06-17 23:23:49 +04:00
|
|
|
and it opens with fluid. When I press "run" or "build" codeblocks
|
|
|
|
calls fluid to generate the c++ files and compiles if needed.
|
2013-06-17 22:41:38 +04:00
|
|
|
"""
|
|
|
|
|
2010-10-30 18:51:32 +04:00
|
|
|
|
|
|
|
|
|
|
|
5 DOCUMENT HISTORY
|
|
|
|
=====================
|
2010-10-28 18:13:01 +04:00
|
|
|
|
2010-10-30 22:21:40 +04:00
|
|
|
Oct 30 2010 - matt: added Code::Blocks chapter
|
2010-10-28 18:13:01 +04:00
|
|
|
Oct 28 2010 - matt: restructured entire document and verified instructions
|
2010-11-14 19:37:34 +03:00
|
|
|
Nov 14 2010 - duncan: added install-desktop
|
2013-06-17 22:41:38 +04:00
|
|
|
Jun 17 2013 - erco: added mingodad's CodeBlocks/Fluid recommendations
|