1 README.Unix.txt - 2010-11-14 - Building FLTK on Unix
2 -----------------------------------------------------
14 2.4 * http://www2.mandriva.com/
15 2.5 * http://www.opensuse.org/en/
16 2.6 * http://www.debian.org/
21 3 HOW TO BUILD FLTK USING GCC
23 3.2 Downloading and Unpacking
28 3.7 Creating new Projects
29 4 CREATING A NEW PROJECT IN CODE::BLOCKS
32 * TODO: we still need to write these chapters
39 FLTK currently supports the following development environments on vmost Unix
42 - gcc command line tools
46 The Symbol font and the Zapf Dingbats font do not work on X11. This is correct
47 behavior for UTF-8 platforms.
58 Ubuntu Linux can be downloaded here:
60 http://www.ubuntu.com/
62 If you have not done so yet, download and install Ubuntu.
64 Open a shell and install some software:
66 sudo apt-get install g++
67 sudo apt-get install gdb
68 sudo apt-get install subversion
69 sudo apt-get install autoconf
70 sudo apt-get install libx11-dev
71 sudo apt-get install libglu1-mesa-dev
73 These two are optional, but highly recommended:
75 sudo apt-get install libasound2-dev
76 sudo apt-get install libxft-dev
78 If you are planning to use the Code::Blocks IDE, also install this
80 sudo apt-get install codeblocks
82 I like to use subversion to install the latest FLTK-1.3.release:
84 svn co http://svn.easysw.com/public/fltk/fltk/branches/branch-1.3/ fltk-1.3
86 To update to the latest version, just go into the fltk-1.3 directory and type
94 Linux Mint 9 can be downloaded here:
96 http://www.linuxmint.com/
98 If you have not done so yet, download and install Linux Mint.
100 Open a shell and install some software:
102 sudo apt-get install g++
103 sudo apt-get install gdb
104 sudo apt-get install subversion
105 sudo apt-get install autoconf
106 sudo apt-get install libx11-dev
107 sudo apt-get install libglu1-mesa-dev
109 These two are optional, but highly recommended:
111 sudo apt-get install libasound2-dev
112 sudo apt-get install libxft-dev
114 If you are planning to use the Code::Blocks IDE, also install this
116 sudo apt-get install codeblocks
118 I like to use subversion to install the latest FLTK-1.3.release:
120 svn co http://svn.easysw.com/public/fltk/fltk/branches/branch-1.3/ fltk-1.3
122 To update to the latest version, just go into the fltk-1.3 directory and type
126 FIXME: no FL_SYMBOL font (-*-symbol-*), font 15 (Zapf-Dingbats)
132 Fedora 13 Linux can be downloaded here:
134 http://fedoraproject.org/
136 If you have not done so yet, download and install Fedora.
138 Open a terminal window and install some software. In Fedora, the default user
139 has no permission to call "sudo", so we will change user a few times:
142 yum groupinstall "Development Tools"
143 yum groupinstall "X Software Development"
145 If you are planning to use the Code::Blocks IDE, also install this
147 yum install codeblocks.i686 (for 64 bit machines)
149 Don't forget to leave root status (Ctrl-D) before loading FLTK. To install FLTK
150 for every user, you either have to set root user again, or use "visudo" to add
151 yourself to the "sudo" list.
153 I like to use subversion to install the latest FLTK-1.3.release:
155 svn co http://svn.easysw.com/public/fltk/fltk/branches/branch-1.3/ fltk-1.3
157 To update to the latest version, just go into the fltk-1.3 directory and type
161 FIXME: no FL_SYMBOL font (-*-symbol-*), font 15 (Zapf-Dingbats)
165 3 HOW TO BUILD FLTK USING GCC
166 ================================
169 3.1 Downloading and Unpacking
170 --------------------------------
172 Download FLTK from here:
174 http://www.fltk.org/software.php
176 If you are familiar with "subversion" and like to stay current with your
177 version, you will find the subversion access parameters at the bottom of that
178 page. Unpack FLTK into a convenient location. I like to have everything in my
184 mv ~/Downloads/fltk-1.3.xxxx.tar.gz .
185 tar xvfz fltk-1.3.xxxx.tar.gz
190 -----------------------
192 Stay in your FLTK source-code directory. Type:
196 Now configure your FLTK installation:
200 ADVANCED: type "./configure --help" to get a complete list of optional
201 configurations parameters. These should be pretty self-explanatory. Some
202 more details can be found in README.
205 The configuration script will check your machine for the required resources
206 which you should have installed as described in the Prerequisites chapter. Review
207 the Configuration Summary, maybe take some notes.
213 Now this is easy. Stay in your FLTK source-code directory and type:
217 The entire FLTK toolkit including many test programs will be built for you. No
218 warnings should appear. If some do, please let the FLTK developer team know via
219 the mailing list or the bug reporting template at www.fltk.org .
221 Actually, as of Oct 28 2010, quite a bunch of warnings will show, mostly about
222 suggested parenthesis. Please ignore them until we can fix them.
228 After a successful build, you can test FLTK's capabilities:
234 ----------------------
236 If you did not change any of the configuration settings, FLTK will be installed
237 in "/usr/local/include" and "/usr/local/lib" by typing
241 If you are using the KDE, GNOME or XFCE desktop environments and want to call
242 "fluid" from the desktop menu, you will need to install additional files and
243 icons under "/usr/share" by typing:
245 sudo make install-desktop
247 It is possible to install FLTK without superuser privileges by changing the
248 installation path to a location within the user account by adding the
249 "--prefix=PREFIX" parameters to the "./configure" command.
252 3.6 Creating new Projects
253 ----------------------------
255 FLTK provides a neat script named "fltk-config" that can provide all the flags
256 needed to build FLTK applications using the same flags that were used to build
257 the library itself. Running "fltk-config" without arguments will print a list
258 options. The easiest call to compile an FLTK application from a single source
261 fltk-config --compile myProgram.cxx
263 "fltk-config" and "fluid" will be installed in "/usr/local/bin/" by default. I
264 recommend that you add it to the command search path.
268 4 CREATING A NEW PROJECT IN CODE::BLOCKS
269 ===========================================
271 Code::Blocks is a free and popular C++ IDE in the Linux world. It also runs on
272 OS X and MSWindows. Configured correctly, it can also cross-compile between
273 these platforms. This chapter focuses on creating a new FLTK project for Linux,
274 assuming that FLTK 1.3 was previously built and installed in its default
275 location from the command line.
277 If not done yet, install Code::Blocks as described in the Prerequisites chapter
278 above, or download it from their web site. This description is based on
281 http://www.codeblocks.org/
283 Start Code::Blocks. Select File > New > Project. In the "New from template"
284 dialog box, click on "FLTK project" and follow the instructions.
286 The default project support basic fltk. If you would like to add support for
287 images, OpenGL, GLUT, or Forms, add the corresponding flags --use-images,
288 --use-gl, --use-glut, and --use-forms respectively.
290 The flags are located in the "Project Build Options" dialog. To change the
291 compiler flags, select your project in the tree view, then select the
292 "Compiler Settings" tab, then "Other Options" and add the flags to
293 `fltk-config --cxxflags` in front of the second "`".
295 The linker flags are located in the "Linker Settings" tab under "Other Linker
296 Options". Add the flags to `fltk-config --ldstaticflags` in front of the
302 =====================
304 Oct 30 2010 - matt: added Code::Blocks chapter
305 Oct 28 2010 - matt: restructured entire document and verified instructions
306 Nov 14 2010 - duncan: added install-desktop