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
|
FAQ - Frequently Asked Question
===============================
This is a summary of the FAQ at www.freepascal.org. See there for a complete
and uptodate list.
1. General
++++++++++
--------------------------------------------------------------------------------
Do I need ppc386.cfg or fpc.cfg?
You only need fpc.cfg. This way the compiler knows where to find the libraries.
--------------------------------------------------------------------------------
How do I compile lazarus?
Do something like this:
$ cd lazarus
$ make
How do I build other projects based upon the LCL
Add the following lines to the end of your fpc.cfg
# Add Lazarus libs
-Fu/your.lazarus.root/lcl/units
-Fu/your.lazarus.root/lcl/units/{YourToolKit}
-Fu/your.lazarus.root/components/units
-Fu/your.lazarus.root/components/units/{YourToolKit}
where {YourToolKit} may be gtk, gnome or win32 and run:
ppc386 your.project.pp
--------------------------------------------------------------------------------
What version of FPC is required?
Currently you need to use 1.0.10 of the FPC compiler. You can find the URL in
the downloads section of this site.
--------------------------------------------------------------------------------
I can't compile Lazarus
1. Check if the compiler has the correct version
2. Check if the (fpc)libraries are from the same version.
3. Check if you have a fpc.cfg and no old ppc386.cfg
4. Check also the OS-dependent FAQs
--------------------------------------------------------------------------------
When I try to compile delphi projects under lazarus, I have an error at the
line:
{$R *.DFM}
How can I solve this problem ?
Lazarus (or better Linux) doesn't know about resources, so you can't use them
in the way Delphi/win32 does. However Lazarus uses a method pretty compatible
with this.
You can still use your Delphi layouts if you use the following steps:
1. You need a textual version of all form files (dfm)
D4: created by copy/paste from ALT-F12
D5: Native
2. Create a file with lazres (in lazarus/tools)
lazres yourform.lrs yourform.dfm
3. Add the following initialization section to every unit with a form:
initialization
{$I yourform.lrs}
Please keep in mind that not all properties in the dfm are supported yet by
lazarus, so you might get a crash.
--------------------------------------------------------------------------------
when accessing events of objects e.g. the onclick event of a button I get the
following error. ERROR unit not found: stdCtrls
Either your "Other sources" path or your FPC source path is not sufficient.
Lazarus is the IDE and the visual components library LCL.
All other stuff, like IO, Database, FCL and RTL are provided by FPC.
The IDE needs the paths to all sources.
The path to the lazarus sources is normally automatically set. Check
Run->Compiler Options->Search Paths->Other Sources
for
$(LazarusDir)/lcl;$(LazarusDir)/lcl/interfaces/$(LCLWidgetType)
The FPC source path can be set via:
Environment -> General Options -> Files -> FPC source path
--------------------------------------------------------------------------------
================================================================================
1. Linux
++++++++
--------------------------------------------------------------------------------
I have SuSE and I get
/usr/bin/ld: cannot find -lgtk
Error: Error while linking
SuSE installs the gtk devel libs under /opt/gnome/lib, which is not in
the standard lib path. Simply add it to your /etc/fpc.cfg.
(-Fl/opt/gnome/lib).
--------------------------------------------------------------------------------
How can I debug lazarus and lcl on Linux?
First of all you need a debugger. gdb is the standard debugger under linux and
there are several GUI-frontends available. One common frontend is ddd, which is
part of most common distributions. To compile lazarus/lcl with debug-information
you should then use the following commands to start a debug session:
$ make clean; make OPT=-dDEBUG
$ ddd lazarus
Be warned however, that ddd is not as comfortable as e.g. the Delphi debugger.
Specially if it comes to view the contents of a variable you have to take into
account that ddd/gdb are case sensitive whereas Pascal is case-insensitive.
Therefore you have to type all variable names in uppercase to see their
contents. For more information take a look into the fpc-manuals.
--------------------------------------------------------------------------------
I can debug now but ddd does not find my sources or complains that they contain
no code. Whats that?
This is a path-related problem with either gdb or ddd. You can aviod this by
* Use the "Change directory" command from the ddd menu and choose the
directory where the sources are located. The drawback of this method is
that you now can't use the source of the program you started
with (e.g. lazarus). Thus it may be neccessary to change the directory
multiple times.
* In ddd goto [Edit] [gdb-settings] and set the search-path
*
Create a $(HOME)/.gdbinit file like:
directory /your/path/to/lazarus
directory /your/path/to/lazarus/lcl
directory /your/path/to/lazarus/lcl/include
--------------------------------------------------------------------------------
I receive an error during the linking that states /usr/bin/ld can't
find -l<some lib>
All though you have installed the package <packagename> which provides
<some lib>, you also need the development package, normally called
<packagename>-dev
--------------------------------------------------------------------------------
How can I convert a kylix 2 project into a lazarus project?
Nearly the same way as converting a Kylix project into a Delphi/VCL project.
The LCL (Lazarus Component Library) tries to be compatible to Delphis VCL.
Kylix CLX tries to be QT compatible.
Here are some general hints:
* rename all used CLX Q-units like QForms, QControls, QGraphics, ... into
their VCL counterparts: Forms, Controls, Graphics, ...
* Add LResources to the uses section of every form source
* rename or copy all .xfm files to .lfm files.
* remove {$R *.xfm} directive
* add an initialization section to each form source and add an include
directive for the .lrs file (lazarus resource file):
initialization
{$I unit1.lrs}
The .lrs files can be created via the lazres tool in
(lazarusdir)/tools/lazres.
For example: ./lazres unit1.lrs unit1.lfm
* Fix the differences. The LCL does not yet support every property of the
VCL and the CLX is not fully VCL compatible.
--------------------------------------------------------------------------------
When compiling lazarus the compiler can not find a unit. e.g.: gtkint.pp(17,16)
Fatal: Can't find unit GLIB
1. Check a clean rebuild: do a 'make clean all'
2. Check if the compiler has the correct version (1.0.10 or 1.1)
3. Check if the compiler is using the right config file. The normal
installation creates /etc/fpc.cfg. But fpc also searches for
~/.ppc386.cfg, ~/.fpc.cfg, /etc/ppc386.cfg and it uses only the first
it finds.
Hint: You can see which config file is used with 'ppc386 -vt bogus'
4. Check if the config file (/etc/fpc.cfg) contains the right paths to your
fpc libs. There must be three lines like this:
-Fu/usr/lib/fpc/$version/units/$target
-Fu/usr/lib/fpc/$version/units/$target/*
-Fu/usr/lib/fpc/$version/units/$target/rtl
The first part of these paths (/usr/lib/fpc) depends on your system. On
some systems this can be for example /usr/local/lib/fpc/... .
Hint: You can see your searchpaths with 'ppc386 -vt bogus'
5. Check that the config file (/etc/fpc.cfg) does not contain search paths
to the lcl source files (.pp, .pas):
forbidden: -Fu(lazarus_source_directory)/lcl
forbidden: -Fu(lazarus_source_directory)/lcl/interfaces/gtk
If you want to add the lcl for all your fpc projects, make sure that
the two paths look like the following and are placed after the above
fpc lib paths:
-Fu(lazarus_source_directory)/lcl/units
-Fu(lazarus_source_directory)/lcl/units/gtk
6. Check if the missing unit (glib.ppu) exists in your fpc lib directory.
For example the gtk.ppu can be found in
/usr/lib/fpc/$version/units/linux/gtk/.
If it does not exists, the fpc lib is corrupt and should be reinstalled.
7. Check if the sources are in a NFS mounted directory. In some cases the
NFS updates created files incorrectly. Plz try move the sources into a
non NFS directory and compile there.
--------------------------------------------------------------------------------
I have installed the binary version, but when compiling a simple project,
lazarus gives: Fatal: Can't find unit CONTROLS
Probably you are using a newer fpc package, than that used for building the
lazarus binaries. The best solution is to download the sources and compile
lazarus manually. You can download the source snapshot or get the source
via svn:
$ svn checkout http://svn.freepascal.org/svn/lazarus/trunk lazarus
$ cd lazarus
$ make
Make sure that lazarus get the new source directory:
Environment->General Options->Files->Lazarus Directory
Top
Lazarus compiles, but linking fails with: libgdk-pixbuf not found
Either install the gdk-pixbuf library for gtk1.x or disable the use:
Where to find the gdk-pixbuf library:
RPMs:
http://rpmfind.net/linux/rpm2html/search.php?query=gdk-pixbuf&submit=Search+...&system=&arch=
Debian packages:
libgdk-pixbuf-dev
Sources:
ftp://ftp.gnome.org/pub/gnome/unstable/sources/gdk-pixbuf/
--------------------------------------------------------------------------------
================================================================================
3. Windows
--------------------------------------------------------------------------------
When I cycle the compiler, I get:
The name specified is not recognized as an internal or external command,
operable program or batch file.>& was unexpected at this time.
In the compiler dir exists an OS2 scriptfile named make.cmd. NT sees this also
as a script file, so remove it since on NT we don't need it.
--------------------------------------------------------------------------------
When I cycle the compiler, I get:
make[3]: ./ppc1.exe: Command not found
I don't know why but somehow make has lost its path. Try to cycle with a
basedir set like:
make cycle BASEDIR=your_fpc_source_dir_herecompiler
--------------------------------------------------------------------------------
When I try to make Lazarus I get:
make.exe: *** interfaces: No such file or directory (ENOENT).
Stop.make.exe: *** [interfaces_all] Error 2
You need to upgrade your make.
--------------------------------------------------------------------------------
When I try to login at SVN I get:
SVN.EXE [login aborted]: could not find out home directory
On a windows platform the HOME environment variable is required to store
your (SVN) username and password. From the command prompt issue:
SET HOME=C:MyHome
or
SET HOME=C:WINDOWS
or
SET HOME=C:WINDOWSProfilesYourLoginName
or
any other place you like
--------------------------------------------------------------------------------
|