Debian Codegraph @

Documentation/Tutorial/Kavanek/01-Installing.xml

raw
1 <?xml version="1.0" encoding="iso-8859-1"?>
2 <page title="ClanLib Tutorial">
3 <section title="Installing ClanLib">
4 <p align="center">
5 <a href="#downloading">Downloading</a> |
6 <a href="#linux">Installing on Linux</a> |
7 <a href="#pkgconfig">Pkgconfig</a> |
8 <a href="#windows">Installing on Windows</a> |
9 </p>
10
11 <h3>Installing ClanLib on Linux/Windows</h3>
12 <p>
13 This part of the tutorial describes how to install the ClanLib-0.8.x on your Unix or Windows system.
14 After reading these lines you should be well prepared to write your first application using ClanLib.
15 </p>
16
17 <br/>
18
19 <h4><a name="downloading">Downloading</a></h4>
20 <p>
21 If you decided to use ClanLib in your program the first step you should do is downloading necessary
22 files from www.ClanLib.org. You need at least the library itself.
23 </p>
24
25 <p>
26 For Unix it's recommended to download latest ClanLib-0.8.x.tar.gz file. On Windows systems you'll
27 probably have easier work with ClanLib-0.8.x.zip archive.
28 </p>
29
30 <br/>
31
32 <h4><a name="linux">Installing on Linux</a></h4>
33 <p>
34 Unpack ClanLib-0.8.x.tar.gz to some folder (for examle /home/you/ClanLib-0.8.0). In this folder
35 you can find INSTALL.linux file with latest installing informations. You should probably be able
36 to find all necessary inrofmations reading next lines, but when you still got troubles INSTALL.linux
37 is the first place you can find answers to your questions.
38 </p>
39
40 <p>
41 Your target is compiling ClanLib now. For compiling ClanLib you also need at least zlib, libjpg,
42 libpng and pkgconfig. You can find downloading links for them at www.clanlib.org, but it's very
43 probably that they are also part of your linux distribution (for example SuSE linux 9.1 contains
44 everything you need).
45 </p>
46
47 <p>
48 You shouldn't have any problem with installing thesse external libraries. Usually the whole work
49 is to dowload apropriate .tgz archive and to write
50 </p>
51
52 <pre>
53 ../configure
54 make
55 make install
56 </pre>
57
58 <p>
59 in the directory you have unpacked the archive to. If needed there are readme files in the
60 directory where you can find help.
61 </p>
62
63 <p><a name="pkgconfig"></a>
64 May be you haven't met pkg-config before. It's not a kind of graphic library like zlib,
65 libjpg or libpng. Pkg-config is usefull program for recieveng informations about libraries
66 installed on your system and ClanLib uses it for it's compilation. Don't worry it will be
67 helpfull for us too. So here is a little description of it's behavior.
68 </p>
69
70 <p>
71 After succesfull installation of ClanLib you can find .pc files in /usr/local/lib/pkgconfig.
72 For example clanApp-0.8.pc file containing informations about libclanApp-0.8.so.0.
73 Pkg-config generates compilator options we'll need for example in our makefiles. You can find
74 real world example in First Application tutorial (will be written soon). Pkg-config searches
75 for .pc files in folders contained in PKG_CONFIG_PATH variable so I recomend you to add the
76 following line to ./bashrc in your home directory:
77 </p>
78
79 <pre>
80 export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig
81 </pre>
82
83 <p>
84 Now we're at last prepared to compile ClanLib itself. Go to the ClanLib's folder and execute
85 configuration script:
86 </p>
87
88 <pre>
89 ../configure
90 </pre>
91
92 <p>
93 You'll recieve quite long list of messages from this script. Somewhere at the end you can find
94 something like this:
95 </p>
96
97 <pre>
98 ------------------------------------------------------------------------------
99 The following modules will be built:
100
101 clanGL = yes
102 clanSDL = yes
103 clanApp = yes
104 clanGUI = yes
105 clanCore = yes
106 clanSound = yes
107 clanNetwork = yes
108 clanSignals = yes
109 clanDisplay = yes
110 clanMikmod = yes
111 clanVorbis = yes
112
113 Build Documentation = yes
114 Debug Build = no
115 -----------------------------------------------------------------------------
116 Configure done.
117
118 Type 'make' to compile ClanLib.
119 </pre>
120
121 <p>
122 When you see "no" next to some of modules names (for example clanSDL = no), it means that
123 ClanLib found that it's impossible to compile this module because of failed dependencies.
124 In this case there should be some more detailed information about this in configure's message
125 list. In our example the problem will probably be solved when you instal SDL library development
126 packages to your system. I recomend you to make your system abele to compile all the ClanLib
127 modules, but of course it's not necessary and alhough you see "clanVorbis = no" you can compile
128 ClanLib and use it without problems utill you need this module. For compiling clanVorbis you'll
129 need something like libogg and libogg-devel.
130 </p>
131
132 <p>
133 Now follow the last instruction of configure script and type 'make' to compile ClanLib. Then
134 the last step is to type 'make install'.
135 </p>
136
137 <p>
138 The only problem I had on older systems after 'make' is typed was problem with too old XFree86.
139 You need XFree86 4.3.0 or higher and of corse acceptable graphic card. When the problem is in
140 XFree86 you'll see words like glXGetProcAddress in error messages of compilator.
141 </p>
142
143 <p>
144 If you have some another problems you can try to find solution in ClanLib mailing lists.
145 </p>
146
147 <br/>
148
149 <h4><a name="windows">Installing on Windows</a></h4>
150 <p>
151 Of course the first step you have to do is unpacking ClanLib-0.8.x.zip file to some folder
152 (C:\Development\ClanLib for example).
153 </p>
154
155 <p>
156 I have personal experience only with Visual Studio 6.0 or .net. If you need to compile and use
157 ClanLib in Borland C++ Builder or somethink like this try to read INSTALL.xx file in the folder
158 (C:\Development\ClanLib in our example), where xx is name you need (borland in this case).
159 </p>
160
161 <p>
162 Same as on Linux you'll need some additional libraries to compile ClanLib on Windows too. The
163 easiest way of getting them is to download ..zip file called External Libraries from www.clanlib.org
164 downloading section. Unpack External Libraries to another folder (C:\Development\ExternalLibraries for example).
165 </p>
166
167 <p>
168 If you are using Visual Studio 6.0 you'll have to do a little bit more probably. Your Visual Studio
169 needs service pack 5 (http://msdn.microsoft.com/vstudio/downloads/updates/sp/vs6/sp5) and
170 Platform SDK (http://www.microsoft.com/msdownload/platformsdk/sdkupdate) is requested too.
171 If you have troubles with downloading whole Platform SDK because of it's size (something about 100 Mb)
172 you can download only Debugging Tools which are only a part, but if you are able to download it all I recommend it.
173 </p>
174
175 <p>
176 Your Visual Studio needs to know where to find include and library files of your external libraries.
177 </p>
178
179 <p>
180 In Visual Studio 6.0 you can do this in Tools->Options->Directories. Here add to Include File's listbox
181 appropriate path (C:\Development\ExternalLibraries\include in our example). Do the same in Library Files's
182 listbox (here add C:\Development\ExternalLibraries\lib in our example). It's recomended to have this
183 new paths on the top of the listboxes.
184 </p>
185
186 <p><img src="Images/IncludeListbox_VC6.png"/></p>
187
188 <p>
189 In Visual Studio 2003 .net you can do this in Tools->Options->Projects->VC++ Directories. Here add to
190 Include File's listbox appropriate path (C:\Development\ExternalLibraries\include in our example).
191 Do the same in Library Files's listbox (here add C:\Development\ExternalLibraries\lib in our example).
192 It's recomended to have this new paths on the top of the listboxes.
193 </p>
194
195 <p><img src="Images/IncludeListbox_VCNet.png"/></p>
196
197 <p>
198 Now you're nearly prepared to compile ClanLib. In the directory where you have unpacked ClanLib-0.8.x.zip
199 to (C:\Development\ClanLib) you will find only one workspace and project called configure.dsw.
200 It's configuration tool that wil generate the real ClanLib workspace and project files. Open this file
201 (answer yes to the question if you're using .net) compile it, execute it and answer it's questions carefully.
202 If you give some incorrect informations to this tool, you'll heve troubles with compilation.
203 You'll be asked where to install ClanLib's include and headder files so you have to decide where you want
204 to have them (C:\Development\CL_Include, C:\Development\CL_Lib for example). Then you should specify where
205 are the ExternalLibraries include and header files (C:\Development\ExternalLibraries\include and
206 C:\Development\ExternalLibraries\lib in our example).
207 </p>
208
209 <p><img src="Images/Configure.png"/></p>
210
211 <p>
212 After succesful running the configure, open the ClanLib.dsw (Visual Studio 6.0) or ClanLib.sln (Visual Studio .net) file.
213 You'll see many different projects (clanApp, ClanDisplay ...). You need to compile at least ClanApp, ClanCore,
214 ClanDisplay and ClanDisplay, but I recomed you to do all the work at once by using Batch Build. You can ignore
215 wrnings you get during the compilation. The files are autamatically installed to the folder you specified in
216 configure tool. So after a succesfull compilation you're done, you're prepared to write your first ClanLib application.
217 </p>
218 </section>
219 </page>