~george-edison55/fltk/trunk

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
README.Unix.txt - 2010-11-14 - Building FLTK on Unix
-----------------------------------------------------



 CONTENTS
========== 

  1   INTRODUCTION
  2   PREREQUISITES
    2.1   Ubuntu 10
    2.2   Linux Mint 9
    2.3   Fedora 13
    2.4   * http://www2.mandriva.com/
    2.5   * http://www.opensuse.org/en/
    2.6   * http://www.debian.org/
    2.7   * Mandrake?
    2.8   * Sun?
    2.9   * SGI?
    2.10  * HPUX?
  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
  4   CREATING A NEW PROJECT IN CODE::BLOCKS
  5   DOCUMENT HISTORY

* TODO: we still need to write these chapters



 1  INTRODUCTION
=================

FLTK currently supports the following development environments on vmost Unix 
platforms:

    - gcc command line tools
    - Code::Blocks
    - ...
    
The Symbol font and the Zapf Dingbats font do not work on X11. This is correct
behavior for UTF-8 platforms.



 2  PREREQUISITES
==================


 2.1  Ubuntu 10
----------------

Ubuntu Linux can be downloaded here:

  http://www.ubuntu.com/
  
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
  
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:

  svn co http://svn.easysw.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


 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:

  svn co http://svn.easysw.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

FIXME: no FL_SYMBOL font (-*-symbol-*),  font 15 (Zapf-Dingbats)


 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"

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:

  svn co http://svn.easysw.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

FIXME: no FL_SYMBOL font (-*-symbol-*),  font 15 (Zapf-Dingbats)



 3  HOW TO BUILD FLTK USING GCC
================================


 3.1  Downloading and Unpacking
--------------------------------

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 
page. Unpack FLTK into a convenient location. I like to have everything in my 
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
  

 3.2  Configuring FLTK
-----------------------

Stay in your FLTK source-code directory. Type:
  
  autoconf

Now configure your FLTK installation:

  ./configure
  
ADVANCED: type "./configure --help" to get a complete list of optional 
configurations parameters. These should be pretty self-explanatory. Some
more details can be found in README. 
:END_ADVANCED

The configuration script will check your machine for the required resources
which you should have installed as described in the Prerequisites chapter. Review
the Configuration Summary, maybe take some notes.


 3.3  Building FLTK
--------------------

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 .

Actually, as of Oct 28 2010, quite a bunch of warnings will show, mostly about 
suggested parenthesis. Please ignore them until we can fix them.


 3.4  Testing FLTK
-------------------

After a successful build, you can test FLTK's capabilities:

  test/demo


 3.5  Installing FLTK
----------------------

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
  
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
  
It is possible to install FLTK without superuser privileges by changing the 
installation path to a location within the user account by adding the 
"--prefix=PREFIX" parameters to the "./configure" command.


 3.6  Creating new Projects
----------------------------

FLTK provides a neat script named "fltk-config" that can provide all the flags 
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
options. The easiest call to compile an FLTK application from a single source 
file is: 

  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.



 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
these platforms. This chapter focuses on creating a new FLTK project for Linux, 
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.

The default project support basic fltk. If you would like to add support for
images, OpenGL, GLUT, or Forms, add the corresponding flags --use-images,
--use-gl, --use-glut, and --use-forms respectively.

The flags are located in the "Project Build Options" dialog. To change the 
compiler flags, select your project in the tree view, then select the
"Compiler Settings" tab, then "Other Options" and add the flags to 
`fltk-config --cxxflags` in front of the second "`". 

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 "`".



 5  DOCUMENT HISTORY
=====================

Oct 30 2010 - matt: added Code::Blocks chapter
Oct 28 2010 - matt: restructured entire document and verified instructions
Nov 14 2010 - duncan: added install-desktop