Sign in Join
Wiki copytemporary

Lazarus FAQ: what changed

Revision 1 to 2. Removed lines have a minus sign; added lines have a plus sign.

OldNewLine
11> **Note:** This FAQ may be **outdated** in certain parts.
22
33## General
44
55### What is Lazarus?
66
77Lazarus is a cross-platform integrated development environment (IDE) that lets you create visual (GUI) and non-visual Object [[Pascal]] programs, and uses the Free Pascal compiler to generate your executable. Its aim is *write once, compile anywhere*: you should be able to just recompile your program source code with Lazarus running on another operating system (or a cross compiler) and get a program that runs on that operating system.
88
99For more details see [[Overview of Free Pascal and Lazarus]]
1010
1111### Why are the generated binaries so big?
1212
1313The binaries are big because they include a lot of debug information necessary for using gdb (GNU Debugger). A debugger is a program that is used to test your code. It uses the extra-information stored in your binary to test it. But once your program is working well, you may delete those infos and reduce the size of the binary.
1414
1515**Quick guide to Lazarus/FPC application size reduction**
1616
1717- 1\. Project\|Compiler Options\|Code\|Smart Linkable (-CX) -\> Checked
1818- 2\. Project\|Compiler Options\|Linking\|Debugging\| Uncheck all except Strip Symbols From Executable (-Xs)
1919- 3\. Project\|Compiler Options\|Linking\|Link Style\|Link Smart (-XX) -\> Checked
2020
2121> **Note:** only do this if you don't need to run the debugger. For more details, see [[Size Matters]]
2222
2323Lazarus executable size starts big, but grows very slowly, because of the way the LCL is designed, and its use of certain Free Pascal features (RTTI). Projects that don't use the LCL are much smaller (this is similar to some non-GUI C++ frameworks). This typically requires more manual coding though.
2424
2525**Exclude image readers** See [[Lazarus 1.10.0 release notes|Lazarus 1.10.0 release notes#LCL Changes]] If your app does not use images compressed in one of those formats, then you can exclude it.
2626
2727### Do I need ppc386.cfg or fpc.cfg?
2828
2929You only need fpc.cfg. This way the compiler knows where to find the libraries.
3030
3131### How do I compile Lazarus?
3232
3333Do something like this:
3434
3535``` bash
3636cd lazarus
3737make clean all
3838```
3939
4040If you want to build Lazarus for different widgetset eg. Qt (supported on Linux, Windows and OSX) then use the LCL_PLATFORM argument:
4141
4242``` bash
4343cd lazarus
4444make clean all LCL_PLATFORM=qt
4545```
4646
4747### Is it possible to build Lazarus projects without the Lazarus IDE?
4848
4949See [[Using the LCL without Lazarus]]
5050
5151### How do I build other Free Pascal programs that use LCL without the Lazarus IDE?
5252
5353See [[Using the LCL without Lazarus]]
5454
5555### What version of FPC is required?
5656
5757Any Lazarus version compiles and works with 2 latest FPC release versions. FPC release cycle is slow and 2 latest versions typically span over few years.
5858
5959Lazarus trunk also supports FPC trunk.
6060
6161- Lazarus 1.0.8 requires at least FPC 2.6.2.
6262- Lazarus 1.0 requires at least FPC 2.6.0.
6363- Lazarus 2.x requires at least FPC 3.0.0
6464- Lazarus 3.0 requires at least FPC 3.2.0
6565
6666### I can't compile Lazarus
6767
68681. Check if the compiler is the correct version
69692. Check if the (fpc) libraries are from the same version
70703. Check if the compiler installation path has spaces in it. Make sure it doesn't!
71714. Check if you have a fpc.cfg and no old ppc386.cfg
72725. Check also the OS-dependent FAQs
73736. If you're still stuck, ask on the forum or Lazarus mailing list
7474
7575### How to embed a small file in the executable, without the need of a separate file? How to embed a resource?
7676
7777Both Lazarus resource and Windows-type/FPC resources are supported. See [[Lazarus Resources]].
7878
7979### What is the meaning of the various file extensions used by Lazarus?
8080
8181The [[Lazarus Tutorial|Lazarus Tutorial#The Lazarus files]] explains some extensions by an example. Here is a brief list:
8282
83-<table>
8483<thead>
85-<tr>
86-<th>extension</th>
87-<th>filetype</th>
88-<th>description</th>
89-</tr>
84+
9085</thead>
9186<tbody>
92-<tr>
93-<td><code>.lpi</code></td>
94-<td>Lazarus Project Information</td>
95-<td>contains project-specific settings like compiler settings and needed packages. stored in XML</td>
96-</tr>
97-<tr>
98-<td><code>.lps</code></td>
99-<td>Lazarus Program Session</td>
100-<td>Personal data like cursor positions, source editor files, personal build modes. stored in XML</td>
101-</tr>
102-<tr>
103-<td><code>.lpr</code></td>
104-<td>Lazarus Program</td>
105-<td>Pascal source of main program.</td>
106-</tr>
107-<tr>
108-<td><code>.lfm</code></td>
109-<td>Lazarus Form</td>
110-<td>Form configuration information for all objects on a form (stored in a Lazarus-specific textual format, similar to Delphi dfm; the actions are described by Pascal source code in a corresponding <code>*.pas</code> file)</td>
111-</tr>
112-<tr>
113-<td><code>.pas</code><br />
87+
11488<code>.pp</code><br />
11589<code>.p</code></td>
116-<td>Pascal code</td>
117-<td>Pascal code typically for a form stored in a corresponding <code>*.lfm</code> file</td>
118-</tr>
119-<tr>
120-<td><code>.lrs</code></td>
121-<td>Lazarus Resource</td>
122-<td>Generated Lazarus Resource file; not to be confused with a Windows resource file. This file can be created with lazres tool (in directory Lazarus/Tools) using commandline: lazres myfile.lrs myfile.lfm</td>
123-</tr>
124-<tr>
125-<td><code>.ppu</code></td>
126-<td>Compiled unit</td>
127-<td>Compiled source code created by the Free Pascal compiler for each unit and program.</td>
128-</tr>
129-<tr>
130-<td><code>.o</code></td>
131-<td>Object file</td>
132-<td>created by the compiler, every ppu file has a corresponding o file, needed by the linker.</td>
133-</tr>
134-<tr>
135-<td><code>.lpk</code></td>
136-<td>Lazarus package information</td>
137-<td>package-specific settings, like compiler settings and needed packages; stored in XML</td>
138-</tr>
139-<tr>
140-<td><code>.lrt</code></td>
141-<td>Lazarus Resourcestring table</td>
142-<td>Lazarus Resourcestring table created when saving a lfm file and i18n is enabled. It contains the TTranslateString properties of the lfm. Do not edit them, they are overwritten.</td>
143-</tr>
144-<tr>
145-<td><code>.rst</code></td>
146-<td>Resourcestring table</td>
147-<td>Resourcestring table created by the compiler for every unit with a resourcestring section. Do not edit them, they are overwritten.</td>
148-</tr>
149-<tr>
150-<td><code>.po</code></td>
151-<td>gnu gettext messages</td>
152-<td>When [[i18n]] is enabled the IDE creates/updated the .po files with the resourcestrings from the rst and lrt files.</td>
153-</tr>
90+
15491</tbody>
155-</table>
15692
15793### Why are TForm.ClientWidth/ClientHeight the same as TForm.Width/Height
15894
15995The TForm.Width/Height do no include the frame, because there was no way to retrieve the frame size on all platforms. Without a reliable way, the LCL would move the forms around on the screen or resize them endlessly.
16096
16197Eventually it will be changed when there is a reliable way to get the size and position of a window with its frame on all platforms. To keep compatibility with older LCL forms, a version number and some extra methods will be added.
16298
16399## Errors
164100
165101Platform specific errors/problems are also covered in sections below.
166102
167103### 'Fatal: Circular unit reference between a and b'
168104
169105A common thing happened to a new user when one wants to create two forms referencing each other's properties. The error above only happens to uses clause of interface section, thus it's OK to put it in implementation section. Example:
170106
171107This one causes error:
172108
173109``` pascal
174110unit a;
175111
176112interface
177113
178114uses b;
179115
180116implementation
181117
182118end.
183119```
184120
185121``` pascal
186122unit b;
187123
188124interface
189125
190126uses a;
191127
192128implementation
193129
194130end.
195131```
196132
197133But this one doesn't:
198134
199135``` pascal
200136unit a;
201137
202138interface
203139
204140implementation
205141
206142uses b;
207143
208144end.
209145```
210146
211147``` pascal
212148unit b;
213149
214150interface
215151
216152implementation
217153
218154uses a;
219155
220156end.
221157```
222158
223159In some cases the **minimal base class** method might be suitable.
224160
225161Separate one class into a minimal base class (what the other needs) and derive it for the rest of the implementation.
226162
227163**unita**: uses unitb
228164
229165``` pascal
230166 type
231167 ClassA = class(BaseClassA)
232168 // rest of ClassA
233169 end;
234170```
235171
236172**unitb**:
237173
238174``` pascal
239175 type
240176 ClassB = class; //forward declaration
241177
242178 BaseClassA = class
243179 // references ClassB
244180 end;
245181
246182 ClassB = class
247183 // references BaseClassA
248184 end;
249185```
250186
251187Discussion: <https://forum.lazarus.freepascal.org/index.php/topic,25667.msg156115.html#msg156115>
252188
253189### When I do *var mytext: text;* to declare a text file, I get "Unit1.pas(32,15) Error: Error in type definition". How can I fix this?
254190
255191The TControl class has a [[doc:lcl/controls/tcontrol.text.html|Text]] property. In a method of a form, that has higher visibility, the [[doc:rtl/system/text.html|Text]] type from the system unit. You can use the [[doc:rtl/system/textfile.html|TextFile]] type, which is just an alias for the Text type or you can add the unit to the type definition.
256192
257193``` pascal
258194var
259195 MyTextFile: TextFile;
260196 MyText: System.Text;
261197```
262198
263199A similar name clash exists with assigning and closing a text file. TForm has a *assign* and a [[doc:lcl/forms/tcustomform.close.html|Close]] method. You can use [[doc:rtl/objpas/assignfile.html|AssignFile]] and [[doc:rtl/objpas/closefile.html|CloseFile]] or add the unit name *System*.
264200
265201### I get an error when using Printer.BeginDoc
266202
267203The unit Printers must be added to the uses section and the *Printer4Lazarus* package must be added to your project requirement in the IDE under: Project \> Project Inspector \> Add \> New Requirement \> Package Name.
268204
269205If the Printer4Lazarus package is not in the list when opening the dropdown box it must be installed. The package is part of the Lazarus installation and can be found in: \[lazarus installed directory\]\[/\|\\\]components\[/\|\\\]printers.
270206
271207If you used the default installation directories \[lazarus installed directory\] is:
272208
273209| Operating system | Lazarus installed directory |
274210|------------------|-----------------------------|
275211| FreeBSD | /usr/local/share/lazarus |
276212| Linux | /usr/lib/lazarus |
277213| macOS | /Library/Lazarus/ |
278214| Windows | c:\lazarus |
279215
280216The same solution also applies to the exception you can get when referencing *Printer.Printers*.
281217
282218### When I try to compile a project, I get an error message "Cannot find Unit ..."
283219
284220Please see [[Unit not found - How to find units]]
285221
286222For information on the error "Cannot find unit interfaces", see the next section.
287223
288224### When I try to compile a project, I get an error message "Cannot find Unit interfaces"
289225
290226This error means that the compiler can not find the file 'interfaces.ppu' **or** the file was found, but it is wrong or outdated (the .ppu file date code is older than the date code of the compiler itself). Testing the compiler option settings can help debug these issues, via Project: Compiler Options... (use the Test button at the bottom of the dialog). This test also lets you check that the {TargetCPU} and {TargetOS} variables are set properly.
291227
292228The interfaces unit can be found in {LazarusDir}\lcl\units\\{TargetCPU}-{TargetOS}\\{LCLWidgetSet}\interfaces.ppu. For example: /home/username/lazarus/lcl/units/i386-linux/gtk/interfaces.ppu.
293229
294230It is normal to have multiple versions of interfaces.ppu (in the proper directories) to allow compiling with different widgets.
295231
296232If the interface.ppu file is in the folder matching the OS and CPU you selected in the project preferences, and you get this error, you are using a different compiler / RTL for compiling your project than you used for compiling your Lazarus IDE, or the libraries need to be recompiled to give the .ppu files newer compilation dates.
297233
298234You can do one of the following:
299235
3002361. Set the compiler in the Environment Options to the one you used to compile Lazarus. Also look carefully in the Environment Options to see if you are using the correct paths for the Lazarus directory and the FPC sources directory. Check that there is only one version of the compiler configuration file fpc.cfg - it should reside in /etc/ for Linux/Unix systems or in the same directory as the fpc compiler for Windows systems. Try to run "fpc -vt bogus" to check which fpc.cfg is being used in your system. Rogue copies often creep in if you have updated your compiler to a new version; they may be found in your home directory or in the same directory as the one in which you built your new compiler. DELETE THESE!
3012372. Rebuild the LCL (or Lazarus completely) with the compiler selected in the Environmnent Options. You can do this with Tools -\> Build Lazarus. Before doing this, check the current settings in Tools -\> Configure Build Lazarus.
3022383. You may also try to change the widgetset currently selected for the project. For example, the sample project "objectinspector" that comes with Lazarus is set to gtk by default. Compiling this project will surely give you "Can't find unit interfaces" in Windows platform. Changing widgetset to default(Win32) in [[IDE Window: Compiler Options|Project Options | Compiler Options...]] should fix this issue.
303239
304240### When I compile a project, that uses a LCL unit, I get a linker error
305241
306242Here is an example for such a linker error:
307243
308244`` /path/to/lazarus/lcl/units/x86_64-linux/wsimglist.o: In function `REGISTERCUSTOMIMAGELIST': ``\
309245`` /path/to/lazarus/lcl//widgetset/wsimglist.pp:266: undefined reference to `WSRegisterCustomImageList' ``
310246
311247- Make sure yor project uses the package LCL. You can check this in the project inspector.
312248- Make sure unit "interfaces" is used as one of the first units of your program.
313249
314250> **Note:** These functions are implemented by the LCL backends. By adding the unit interfaces, you link a LCL backend into your program.
315251
316252### At the line :{\$R *.DFM} How can I solve this problem (Lazarus with FPC \< 2.4.0)?
317253
318254Lazarus (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 (.dfm files) if you use the following steps:
319255
320-- You need a textual version of the .dfm files. D5 and higher are doing this by default. If you have older files: <span class="kbd">Alt</span>+<span class="kbd">F12</span> to see the layout as text and paste/copy. When you have a text .dfm file, just copy it to a .lfm file.
256+- You need a textual version of the .dfm files. D5 and higher are doing this by default. If you have older files: `Alt`+`F12` to see the layout as text and paste/copy. When you have a text .dfm file, just copy it to a .lfm file.
321257- Create a file with lazres (in lazarus/tools) lazres yourform.lrs yourform.lfm
322258- Add the following initialization section to
323259
324260``` pascal
325261initialization
326262{$I yourform.lrs}
327263```
328264
329265Please keep in mind that not all properties in the dfm are supported yet by Lazarus, so you might get a crash.
330266
331267Edit: Since FPC 2.4.0, Delphi style resources are supported, so you don't need to change anything. Even Lazarus SVN already uses it as default projects. Note: it's still advised that you use Lazarus' Delphi project converter as there might still be unsupported properties.
332268
333269### 'Identifier not found LazarusResources'
334270
335271When creating a form Lazarus automaticaly add some extra units to the uses section of your form unit. During the conversion of a delphi unit to a Lazarus unit this does not happen. So you need to add LResources to the Uses section of your form unit.
336272
337273### When accessing events of objects, *e.g.*, the onclick event of a button, I get the following error. ERROR unit not found: stdCtrls
338274
339275Make sure, in the Project -\> Project Inspector, that your project depends on the package "LCL" and that you have installed the FPC sources.
340276
341277Lazarus 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.
342278
343279The FPC source path can be set via: Environment -\> Environment Options -\> Files -\> FPC source directory
344280
345281### 'Fatal: Internal error XXXXYYZZW'
346282
347283An internal error is a compiler error that is not expected to happen (but is prepared to easily track down the problem if happens by giving code XXXXYYZZW). Every internal error is a bug, thus it's advised to report to the bugtracker (with small example that can demonstrate the internal error) when one gets it.
348284
349285=== Fatal: Cannot find \[...\] used by \[...\], incompatible ppu=\[filename\], package \[package name\] ===
350286
351287When the compiler gives the message "Cannot find A used by B", Lazarus checks what pas/pp/ppu files are in the search path, and if there is a ppu file it inserts "incompatible ppu=filename, package".''
352288
353289Explanation: FPC cannot use this ppu for one of these reasons:
354290
355291- it was compiled with another FPC version;
356292- it was compiled with (depends on) some other ppu files that are not in the search path;
357293- you misconfigured some search path(s).
358294
359295Without knowing how you installed FPC + Lazarus, I'd be tempted to delete both and start again (make sure to delete the fpc.cfg file).
360296
361297### Lazarus cannot open a project if last character of the path to it is a space
362298
363299If you try to open a project like `/home/bart/space /test.lpi` (note the space just before /test.lpi), the Lazarus IDE will give an error saying it cannot find `/home/bart/space /test.lpi`.
364300
365301This is a known limit of the IDE, which is caused by the fact that the IDE a.o. has to handle paths that users have supplied in edit controls, which have to be stripped from surrounding spaces. This limitation in no way affects user programs written in FPC/Lazarus. Avoid such pathnames for projects.
366302
367303### strToFloat - EConvertError: "0.nnn" is an invalid float
368304
369305The "0.nnn" can be any floating point number. The problem is that your locale settings (eg DE Germany) are expecting a comma to be the decimal separator in numbers and not a decimal point. The solution is to add this to your code: `DefaultFormatSettings.decimalSeparator := '.';` to override your locale's decimal separator. Alternatively, instead of strToFloat and floatToStr, use the Pascal intrinsics val and str - they always need a decimal point.
370306
371307## Debugger
372308
373309*See also [[GDB Debugger Tips]].*
374310
375311### How do I set up/configure for debugging
376312
377313[[Debugger Setup|Setup the debugger]]
378314
379315### How can I inspect properties?
380316
381317You have to use FPC 2.4 or newer.
382318
383319If you compile your application using -gw (dwarf debug info), you should be able to inspect properties.
384320
385321> **Note:** This is only true for properties that map directly to a variable (the "read" declaration points to a member, not a function).
386322
387323If your property returns the value of a function it is very dangerous to evaluate/inspect it. It would require this function to be called, and very often it would change the values of some of your variables. This would mean it would alter the state of your application in the debugger, and any further code-execution, debugging or inspections would return incorrect results.
388324
389325The optional ability to explicitly inspect the results of functions (with the risks described), and therefore calling code from the debugger is not yet implemented
390326
391327### Why does the debugger not show some Variables/Structures ("no such symbol"/"incomplete type")
392328
393329For problems debugging:
394330
395331- properties
396332- Array of ... (Dynamic Array)
397333- Variables in Nested Procedures
398334- "no such symbol in context"
399335- "incomplete type"
400336
401337Please see [[GDB Debugger Tips]] and the and [[FpDebug|FpDebug#Properties]]
402338
403339### How can I debug FCL components from packages with Lazarus
404340
405341FCL components and classes are built without debug information by default and as a result, gdb cannot access component methods or properties. To build package components they must be rebuilt with a debug-line information "-gl" switch.
406342
407343This example assumes you have a Linux distribution with /usr/local/ installation prefix and that the Database package fcl-db is what is needed to contain debug-line information. While the fcl-db is used in this example, you may issue this make command from ANY of the included packages.
408344
409345Before you begin, you need to locate your FPC path by examining your FPC configuration file. The file (fpc.cfg) is located at /etc/fpc.cfg. Display the contents of fpc.cfg and find your fpc installation path. Look for a line starting with -Fu in the fpc.cfg:
410346
411347`-Fu/usr/local/lib/fpc/$fpcversion/units/$fpctarget/*`
412348
413349Make scripts are installing units into INSTALL_PATH/lib/fpc/\$fpcversion/units/\$fpctarget/, so you must be sure that /usr/local is the installation path, and should be assigned to INSTALL_PREFIX, otherwise the Make scripts will place units where they don't belong or the Make script will fail.
414350
4153511. Open a shell terminal
4163522. cd /user/local/share/src/fpc-2.3.1/fpc/fcl-db/
4173533. sudo make clean all install INSTALL_PREFIX=/usr/local OPT=-gl
418354
419355> **Note:** INSTALL_PREFIX parameter should be properly configured for units to be installed.
420356
421357In the sample below /usr/local is a default fpc path for Linux, but may vary on other OSes.
422358
423359``` bash
424360make clean all install INSTALL_PREFIX=/usr/local OPT=-gl
425361```
426362
427363Finally, after rebuilding any FCL units you may want to rebuild LCL as well.
428364
429365### Problems with GDB on Mac
430366
431367Lazarus has now support for lldb on Mac. See [[Installing Lazarus on macOS|Configuring the lldb debugger]].
432368
433369If you want to use gdb, you can find some info here: [[GDB Debugger Tips|GDB tips for Mac]]
434370
435371### How can I use a log file for debugging?
436372
437373Lazarus provides a basic log framework (style [[DebugLn|debugln(...)]] ) in the unit [[LazLogger]]. See that page for more details.
438374
439375### How can I use a Log-file for debugging the IDE itself?
440376
441377Lazarus itself uses [[LazLogger]].
442378
443379This means that you can run Lazarus with
444380
445381``` bash
446382--debug-log=lazarusdebuglog.txt
447383```
448384
449385If this is not sufficient: in the IDE the extent of the information that is logged can be controlled with `--debug-enable`. See `--help` for a list of keywords, or install the package IdeLazLogger.
450386
451387If you want output on a console (most useful for Windows), add the option **-WC** in the Tools / Configure "Build Lazarus" options. Then rebuild Lazarus.
452388
453389See also [[Console Mode Pascal|Console Mode Pascal#Run in IDE with redirected output]]
454390
455391## Contributing / Making Changes to Lazarus
456392
457393### I created a Patch to dock the IDE Messages form on the "Source Code Editor" form (at bottom)
458394
459395Such patches will not be applied, because they only implement a small part of the needed docking. The goal is to create a complete dock manager and use that. A complete dock manager can dock all IDE windows and it allows to let the user define how to dock. For example dock the messages window above or below the source editor — or not at all. For instance,
460396
461397`+-------------------++--+`\
462398`|menu               ||  |`\
463399`+-------------------+|  |`\
464400`+--++---------------+|  |`\
465401`|PI|| Source Editor ||CE|`\
466402`+--+|               ||  |`\
467403`+--+|               ||  |`\
468404`|  |+---------------++--+`\
469405`|OI|+-------------------+`\
470406`|  ||messages           |`\
471407`+--++-------------------+`
472408
473409The dock manager can store the layout and restore it on next load. Preferably the dock manager can dock in pages too. The dock manager does not need to use drag and drop. All patches implementing docking without a dock manager makes it harder to implement a real dock manager and will be rejected.
474410
475411An example for such a dock manager is the package [[anchordockdsgn]]
476412
477413### I have fixed/improved Lazarus. How can I add my changes to the official Lazarus source?
478414
479415Create a patch and send it to the developers. For details, see [[Creating A Patch]].
480416
481417### How can I install more than one copy of Lazarus?
482418
483419Please see [[Multiple Lazarus]]
484420
485421### How can I become a Lazarus developer and access management in the SVN and bug-tracker?
486422
487423First of all, you must learn about Lazarus, to prove your knowledge and skill. Start by reading the [[Lazarus Documentation]] wiki article, read the Lazarus source code, giving a look at the [Lazarus Bug-Tracker](https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/), fix some bugs, and if you think you are ready, contact the developers on the [mailing list](https://www.mail-archive.com/lazarus@miraclec.com/).
488424
489425## Where is ... defined
490426
491427### Virtual key constants
492428
493-Virtual key constants are defined in [[doc:lcl/lcltype|LCLType]]. Add LCLtype to your <b>uses</b>.
429+Virtual key constants are defined in [[doc:lcl/lcltype|LCLType]]. Add LCLtype to your uses.
494430
495431## Using the IDE
496432
497433### How can I use "identifier completion"?
498434
499435You can invoke identifier completion by pressing \[ctrl\]\[space\]. Under the menu item *Environment -\> Editor Options -\> Code Tools -\> Automatic Features* you can set how quick this should happen automatically.
500436
501437### Can I change the code editor font and colours?
502438
503439Yes, see the menu item *Tools -\> Options* and use the Editor/Display and Colors sections. On Windows you may find that the default Courier (and some other typefaces) are either too sharp or too soft, either selecting/deselecting 'Disable anti-aliasing'. TrueType fonts are an improvement, such as the free "Bitstream Vera Sans Mono" font available from [1](https://download.gnome.org/sources/ttf-bitstream-vera/1.10/). (To install a new font, unzip and copy the files into a suitable folder. In Windows XP you will need to use the Fonts section of the Control Panel. In Windows 7 you may select all the font files, right-click and find an Install option in the pop-up menu)
504440
505441### How can I disable specific compiler warning messages?
506442
507443To disable specific compiler warning messages you can either insert a **{\$WARN number OFF}** directive in your code or use FPC's option **-vm\<x\>**. You can find details for these in FPC's [Programmer's guide](https://www.freepascal.org/docs.html) and Appendix A of the [User's guide](https://www.freepascal.org/docs.html).
508444
509445### What are the IDE command line options?
510446
511447See [[Lazarus command line options]].
512448
513449## Linux
514450
515451### Typing in edit fields generate duplicate letters
516452
517453This is more likely to happen under Ubuntu and Ubunto derived distros, and with GNOME Desktop but other distros/Desktop environments can be affected too.
518454
519455The problem is originated by bugs in the ibus Input Method System. Unfortunately Ibus is the default input method of GNOME desktop.
520456
521457If you don't know what an IM is, this means that you do not need it, and therefore the easiest way is to disable IM's at all.
522458
523459In order to do that you have a number of options, namely:
524460
525461- 1 - Disable (or set to "none") the Input Method in System Settings-\>Preferences-\>Input Method
526462
527463- 2 - Add the three following lines in /etc/profile (system wide)
528464
529465`export GTK_IM_MODULE=gtk-im-context-simple`\
530466`export QT_IM_MODULE=simple`\
531467`export XMODIFIERS=@im=none`
532468
533469- 3 - Add a file named *input_method.sh* containing just the 3 lines above in /etc/profile.d (system wide)
534470
535471- 4 - Add the 3 lines above in the home directory ~/.xprofile (per user). If there's no ~/.xprofile in your home directory, you should create one.
536472
537473- 5 - Create a Lazarus launching script containing the same 3 lines. (affects only Lazarus)
538474
539475Methods 1 and 2 may not survive after a system update, while 3,4 and 5 will.
540476
541477Be aware that both GTK and QT applications may change dynamically the IM. If you experience the problem in an apparently random way, chances are good that some other application is enabling again an IM and fails to set to default when terminates. If such is the case method 5 is the only one suitable.
542478
543479You may find more information about Input Methods, and how to deal with them in:
544480
545481<https://fedoraproject.org/wiki/I18N/InputMethods> (This is Fedora specific but most informations apply in general)
546482
547483<http://www.pinyinjoe.com/linux/ubuntu-12-chinese-setup.htm> (This is Ubuntu specific, but again most informations apply in general. It explains how to **enable** IM but the info can be used also to **disable** it)
548484
549485### How can I debug on Linux without the IDE?
550486
551487First 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:
552488
553489``` bash
554490make clean; make OPT=-dDEBUG
555491ddd lazarus
556492```
557493
558494Be warned, however, that ddd is not as comfortable as, *e.g.*, the Lazarus debugger, especially 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 see the fpc-manuals.
559495
560496### I can debug now but ddd does not find my sources or complains that they contain no code. What's that?
561497
562498This is a path-related problem with either gdb or ddd. You can avoid this by
563499
564500- 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.
565501- In ddd goto \[Edit\] \[gdb-settings\] and set the search-path
566502- Create a \$(HOME)/.gdbinit file like:
567503
568504`     directory /your/path/to/lazarus`\
569505`     directory /your/path/to/lazarus/lcl`\
570506`     directory /your/path/to/lazarus/lcl/include`
571507
572508### I receive an error during the linking that states /usr/bin/ld: cannot find -l\<some lib\>
573509
574510For example:
575511
576512` /usr/bin/ld: cannot find -lgdk`
577513
578514This means an external library was not found. In the above case under Linux it means the libgdk.so or libgdk.a was not found. Normally this means, you forgot to install the development package of this library. In the case of gdk the package is called under the Fedora Core distribution: 'gtk+-devel-1.2.10-33'.
579515
580516**Package Based Distributions**
581517You need to install the package that provides the lib\<somelib\>.so or lib\<somelib\>.a files. Dynamic libs under linux have the extension .so, while static libs have the extension .a. On some Linux distro's you have installed the package (rpm, deb) \<packagename\> which provides \<some lib\>, but you also need the development package (rpm, deb), normally called \<packagename\>-dev, which contains the .a (static lib) and/or the .so (dynamic lib).
582518
583519
584520Some distributions have commands to find which package contains a file:
585521
586522**Mandriva**
587523
588524``` bash
589525urpmf lib<somelib>.so
590526```
591527
592528
593529will list all packages containing the file named lib\<somelib\>.so, you'll have to install those ending in -devel
594530
595531
596532**Debian**
597533
598534
599535install the apt-file utility (apt-get install apt-file) then
600536
601537``` bash
602538apt-file search lib<somelib>.so
603539```
604540
605541
606542will list all packages containing the file named lib\<somelib\>.so, you'll have to install those ending in -dev
607543
608544
609545**SuSE**
610546
611547
612548SuSE installs the gtk devel libs under /opt/gnome/lib (or /opt/gnome/lib64 for 64 bits), which is not in the standard lib path. Simply add it to your /etc/fpc.cfg. (-Fl/opt/gnome/lib).
613549
614550**Source Based Distributions and Manual Compilation (LFS)**
615551Make sure that there is a lib\<somelib\>.a in the path, and that it contains the right version. To let the linker find the dynamic library, create a symlink called lib\<some lib\>.so to lib\<some lib\>\<version\>-x,y.so if necessary (and/or for static lib; lib\<some lib\>.a to lib\<some lib\>\<version\>-x,y.a).
616552
617553
618554**FreeBSD** : As source based distro's, and also make sure you have -Fl/usr/local/lib in your fpc.cfg and/or Lazarus library path. Keep in mind that GTK1.2 has "gtk12" as package name under FreeBSD. (same for glib) NOTE: This has changed as of late. Newest ports have gtk-12 and glib-12 as well. You might stumble on this problem, since FPC requires the "-less" ones, you will need to symlink them like this:
619555
620556``` bash
621557# as root
622558cd /usr/local/lib && ln -s libglib-12.so libglib12.so
623559cd /usr/X11R6/lib && ln -s libgtk-12.so libgtk12.so
624560cd /usr/X11R6/lib && ln -s libgdk-12.so libgdk12.so
625561```
626562
627563
628564**NetBSD** : As source based distro's, and also make sure you have -Fl/usr/pkg/lib in your fpc.cfg and/or Lazarus library path
629565
630566
631567**Fedora** : In the "add/remove software" panel search for: "gtk2-devel", "glibc-devel" ([see here](https://www.mail-archive.com/lazarus@lists.lazarus.freepascal.org/msg03637.html)), "libx11-devel"
632568
633569### I receive a warning during the linking that states: Warning: "crtbeginS.o" (or "crtendS.o") not found
634570
635571The actual filename may also be "crtbegin.o" or "crtend.o"\
636572In most cases linking will not fail.\
637573Here's how to find where that file is (you need to have gcc installed, and gcc needs to target the same architecture as fpc), and tell the fpc (which tells the linker):
638574
639575``` bash
640576bart@simenon ~ $ gcc --print-file-name crtbeginS.o
641577/usr/lib/gcc/x86_64-linux-gnu/5/crtbeginS.o
642578```
643579
644580Add the path into fpc.cfg:
645581
646582`# path to the gcclib`\
647583`#ifdef cpui386`\
648584`#-Fl/usr/lib/gcc/x86_64-linux-gnu/5  if you have a 32-bit fpc: fill in the correct path here`\
649585`#endif`\
650586`#ifdef cpux86_64`\
651587`-Fl/usr/lib/gcc/x86_64-linux-gnu/5`\
652588`#endif`
653589
654590Note: On Linux the default (external) linker is ld. This is part of the linux distribution and not part of, or built with, FreePascal.
655591
656592### How can I convert a Kylix 2 project into a Lazarus project?
657593
658594Nearly the same way as converting a Kylix project into a Delphi/VCL project.
659595
660596The LCL (Lazarus Component Library) tries to be compatible to Delphi's VCL. Kylix's CLX tries to be QT compatible. Here are some general hints:
661597
662598- Rename all used CLX Q-units like QForms, QControls, QGraphics, ... into their VCL counterparts: Forms, Controls, Graphics, ...
663599- Add LResources to the uses section of every form source
664600- Rename or copy all .xfm files to .lfm files.
665601- Rename or copy .dpr file to .lpr file.
666602- Add "Interfaces" to the uses section in the .lpr file.
667603- Remove {\$R *.res} directive
668604- Remove {\$R *.xfm} directive
669605- Add {\$mode objfpc}{\$H+} or {\$mode delphi}{\$H+} directive to .pas and .lpr files
670606- Add an initialization section to the end of each form source and add an include directive for the .lrs file (Lazarus resource file):
671607
672608``` pascal
673609initialization
674610{$I unit1.lrs}
675611```
676612
677613
678614The .lrs files can be created via the lazres tool in: (lazarusdir)/tools/lazres.
679615
680616For example: ./lazres unit1.lrs unit1.lfm
681617
682618- Fix the differences. The LCL does not yet support every property of the VCL and the CLX is not fully VCL compatible.
683619
684620- To make it more platform independent, reduce unit libc (which is deprecated) references and substitute with native FPC units like baseunix/unix as much as possible. This will be necessary to support other targets than linux/x86 (including macOS, FreeBSD and Linux/x86_64)
685621
686622### When compiling lazarus the compiler can not find a unit. e.g.: gtkint.pp(17,16) Fatal: Can't find unit GLIB
687623
6886241\. Check a clean rebuild: do a 'make clean all'
689625
6906262\. Check if the compiler has the correct version (2.0.4 or higher)
691627
6926283\. 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.
693629
694630
695631**Hint:** You can see which config file is used with 'ppc386 -vt bogus'
696632
697633Remove any ppc386.cfg as it is really obsolete.
698634
6996354\. Check if the config file (/etc/fpc.cfg) contains the right paths to your fpc libs. There must be three lines like this:
700636
701637`   -Fu/usr/lib/fpc/$fpcversion/units/$fpctarget`\
702638`   -Fu/usr/lib/fpc/$fpcversion/units/$fpctarget/rtl`\
703639`   -Fu/usr/lib/fpc/$fpcversion/units/$fpctarget/*`
704640
705641
706642The first part of these paths (/usr/lib/fpc) depends on your system. On some systems this can be for example /usr/local/lib/fpc/... .
707643
708644**Hint:** You can see your searchpaths with 'ppc386 -vt bogus'
709645
7106465\. Check that the config file (/etc/fpc.cfg) does not contain search paths to the lcl source files (.pp, .pas):
711647
712648` forbidden: -Fu(lazarus_source_directory)/lcl`\
713649` forbidden: -Fu(lazarus_source_directory)/lcl/interfaces/gtk`
714650
715651
716652If 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:
717653
718654` -Fu(lazarus_source_directory)/lcl/units/$fpctarget`\
719655` -Fu(lazarus_source_directory)/lcl/units/$fpctarget/gtk`
720656
7216576\. 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/\$fpcversion/units/i386-linux/gtk/. If it does not exists, the fpc lib is corrupt and should be reinstalled.
722658
7236597\. Check if the sources are in a NFS mounted directory. In some cases the NFS updates created files incorrectly. Please, try to move the sources into a non NFS directory and compile there.
724660
7256618\. If you are still not succeeded try to use samplecfg script as follows:
726662
727663*\#* cd /usr/lib/fpc/*version*/
728664
729665*\#* sudo ./samplecfg /usr/lib/fpc/*\\\$version* /etc
730666
731667> **Note:** Do not a slash ("/") after etc, because if you do, the system will create a folder `/etc/fpc.cfg/fpc.cfg`. In fact, we want samplecfg to make a file `/etc/fpc.cfg`, not the folder `/etc/fpc.cfg`.
732668
733669### I have installed the binary version, but when compiling a simple project, Lazarus gives: Fatal: Can't find unit CONTROLS
734670
735671Probably 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:
736672
737673``` bash
738674bash
739675svn checkout http://svn.freepascal.org/svn/lazarus/trunk lazarus
740676cd lazarus
741677make clean all
742678```
743679
744680Make sure that Lazarus get the new source directory: Environment-\>General Options-\>Files-\>Lazarus Directory Top
745681
746682### Lazarus compiles, but linking fails with: libgdk-pixbuf not found
747683
748684Install the gdk-pixbuf library for gtk1.x:
749685
750686Where to find the gdk-pixbuf library:
751687
752688RPMs: <https://rpmfind.net/linux/rpm2html/search.php?query=gdk-pixbuf&submit=Search+>...&system=&arch=
753689
754690Debian packages: libgdk-pixbuf-dev
755691
756692Sources: <ftp://ftp.gnome.org/pub/gnome/unstable/sources/gdk-pixbuf/>
757693
758694**Ubuntu 8.10:**
759695
760696If you are compiling Lazarus with GTK 2.0 you'll get a "libgdk-pixbuf2.0" not found error. Just install libgtk2.0-dev using apt on this way:
761697
762698``` bash
763699apt-get install libgtk2.0-dev
764700```
765701
766702### I have SuSE and I get /usr/bin/ld: cannot find -lgtk Error: Error while linking
767703
768704Older SuSE versions (before SuSE 11) install the gtk devel libs under /opt/gnome/lib (or /opt/gnome/lib64 for 64 bits), which is not in the standard lib path. Simply add it to your /etc/fpc.cfg (-Fl/opt/gnome/lib).
769705
770706### I have Kubuntu and I get /usr/bin/ld: cannot find -lgtk-x11-2.0
771707
772708You can either use the QT or the GTK2 backend. Default is GTK2. For GTK2 install the kubuntu package *libgtk2.0-dev*.
773709
774710### Lazarus crashes with runtime error 211 after I installed a component
775711
776712After I installed a component, Lazarus crashes with the following message:
777713
778714`Threading has been used before cthreads was initialized.`\
779715`Make cthreads one of the first units in your uses clause.`\
780716`Runtime error 211 at $0066E188`
781717
782718How can I fix this?
783719
784720Your freshly installed component is using threads. FPC on *nix doesn't automatically include threading support, but it must be intialized. This initialization is done in the cthreads unit. Every application using the component needs to add this unit to the uses clause of the main program. Lazarus itself is no exception. This can be done in two ways:
785721
7867221\) Open the package. In the package editor click on *Options*. Under page *Usage* add to the *custom* options **-dUseCThreads**. Then rebuild the IDE. This way the cthreads unit will be automatically used by the IDE under unix and the cthreads are initialized.
787723
7887242\) In order to avoid modifying package, an FPC compiler option could be used directly. Open menu Tools-\>Configure "build Lazarus". "Configure build Lazarus" dialog will be shown; in field "Options:" type `-Facthreads` and then press "OK" button. The next step is to install the package. Lazarus will be built with option -Facthreads which means that it will treat main program as if unit cthreads where first in uses clause.
789725
790726*Hint:* Maybe your old (non-crashing) Lazarus executable is stored as lazarus.old in the same directory as the crashing Lazarus executable.
791727
792728See also [[Multithreaded Application Tutorial|Multithreaded Application Tutorial#Units needed for a multithreaded application]]
793729
794730### When I run a program with threads I get runtime error 232
795731
796732The complete error message is:
797733
798734`This binary has no thread support compiled in.`\
799735`Recompile the application with a thread-driver in the program uses`\
800736`clause before other units using thread.`\
801737`Runtime error 232`
802738
803739**Solution**: Add cthreads as first unit to the uses clause of your main program, usually the .lpr-file.
804740
805741### I have Ubuntu Breezy/Mandriva KDE3 and my fonts in Lazarus IDE look too big
806742
807743If Lazarus is compiled with Gtk1.2, the settings in Gnome Preferences/Font don't have any effect as they are related to Gtk2. You could try this solution: Create a file named .gtkrc.mine in your home directory (if it's not already there) and add these lines to it:
808744
809745`style "default-text" {`\
810746`       fontset = "-*-arial-medium-r-normal--*-100-*-*-*-*-iso8859-1,\`\
811747`                  -*-helvetica-medium-r-normal--*-100-*-*-*-*-*-*"`\
812748`}`\
813-\
749+
814750`class "GtkWidget" style "default-text"`
815751
816752If this is not enough try and create also a .gtkrc symlink to .gtkrc.mine . It worked in this way under Xubuntu 7.10, Mandriva 2009.0 KDE3.
817753
818754### How can my gtk programs use custom rc files?
819755
820756Option a) Name the rc file *yourprogram.gtkrc* and put it in the same directory where the executable is.
821757
822758Option b) Use unit *GtkInt* and call *GTKWidgetSet.SetRCFilename('your_preferred_rc_file');* Best done before *Application.Initialize* in the .lpr file with *{\$IFDEF LCLGtk}*.
823759
824760Option c) Use unit *gtk2* and call *gtk_rc_parse('your_rc_file'));* and *gtk_rc_reparse_all;*.
825761
826762### I have Ubuntu and I cannot compile for Gtk2 due to missing libraries
827763
828764Ubuntu has a problem with not creating all the symbolic links that you'll need even when the libraries are installed. Make sure that all missing libraries when trying to link for Gtk2 have their appropriate links. For instance, you might need to do:
829765
830766``` bash
831767cd /usr/lib
832768sudo ln -s libgdk-x11-2.0.so.0 libgtk-x11-2.0.so
833769```
834770
835771Make sure that the \[whatever\].so symbolic links are created and point to the actual libraries.
836772
837773### Lazarus runs differently with Linux vs. Windows. What do I need to know?
838774
839775If you use readln(); and writeln(); for your input and output the console window (sometimes called terminal window) is not going to pop up as it does with Windows. You will need to access this window with View - Debug Windows - Terminal Output. Unlike with Windows you can not use backspace to correct typing errors. The 'Enter' key on the numeric keypad may not work either, depending on the widgetset the IDE was built for. Type carefully!
840776
841777Because Linux is case sensitive you will need to take care that you pay attention to case when referencing or accessing files.
842778
843779## Windows
844780
845781### When I cycle/rebuild the compiler, I get
846782
847783#### The name specified is not recognized as an internal or external command, operable program or batch file.\>& was unexpected at this time
848784
849785In the compiler directory there is an OS2 scriptfile named make.cmd. Different versions of Windows also see this as a script file, so remove it since what is needed for OS2 becomes a hindrance on Windows.
850786
851787#### make\[3\]: ./ppc1.exe: Command not found
852788
853789Somehow make has lost its path (reason unknown). Try to cycle with a basedir set like:
854790
855791```dos
856792make cycle BASEDIR=your_fpc_source_dir_herecompiler
857793```
858794
859795### When I try to make Lazarus I get:
860796
861797#### make.exe: * * * interfaces: No such file or directory (ENOENT). Stop.make.exe: * * * \[interfaces_all\] Error 2
862798
863799You need to upgrade your make.
864800
865801#### makefile:27: *** You need the GNU utils package to use this Makefile. Stop.
866802
867803Make sure you didn't install FPC in a path with spaces in the name. The Makefile doesn't support it.
868804
869805### How can I give my program an XP look like Lazarus has?
870806
871807Project -\> Project Options -\> Check 'Use manifest to enables themes'.
872808
873809### When I run Windows program created in Lazarus it starts with a DOS window
874810
875811Specify the -WG argument (Windows GUI) on the command line of the compiler or in the Lazarus IDE check the Windows GUI check box on the compiler options dialog box (Project menu -\> Compiler Options -\> Config and Target -\> target OS Specific options.
876812
877813## macOS
878814
879815### Why does compiling a project fail with 'unknown section attribute: no_dead_strip'?
880816
881817Dead code stripping is not supported by the assembler and linker before Xcode 1.5 (available for macOS 10.3.9). Disable the compiler options:
882818
883819- Code \> Unit style \> Smart linkable (-CX)
884820- and Linking \> Link Style \> Link smart (-XX)
885821
886822### Xcode 3.1 and later
887823
888824The macOS linker in Xcode 3.1 (2007, Leopard 10.5) and later does not support stripping the symbol table attached to the output of the assembler and link editor. The linker supported stripping, for 32 bit executables only, up to Xcode 2.5 (2005, Tiger 10.4).
889825
890826You will need to manually run the strip command line utility instead after compiling your executable.
891827
892828### Debugging
893829
894830[[GDB Debugger Tips|Please see here for debugger issues under macOS]]
895831
896832## Licensing
897833
898834### Can I make commercial applications with Lazarus?
899835
900836Yes, the LCL is licensed under the [[FPC modified LGPL|LGPL with an exception]], which allows you to link to it statically without releasing the source of your application. Modifications and enhancements to the LCL must be distributed with source. Lazarus, the IDE, is licensed under the GPL. The LCL consists only of the code in the directory named "lcl", other code may not be covered by this statement.
901837
902838### Why are some components restricted from usage in commercial application?
903839
904840Lazarus comes with additional components, that were developed by third parties. Those are under various other Licenses. If you wish to use them you need to see the License within the source files of those packages. Most of those 3rd party components are in the directory "components".
905841
906842### How do I know if a Component is part of the LCL?
907843
908844All LCL units are in the directory "lcl". A list of units belonging to the LCL can be found [here](https://lazarus-ccr.sourceforge.io/docs/lcl/). If your code uses units not listed on this page, you may have used a component that is not part of the LCL.
909845
910846### Can I make commercial plug-ins for Lazarus?
911847
912848Yes, the IDEIntf part of the IDE is licensed under the LGPL with the same exception, so that shared data structures in this part will not force you to license your plug-in or design-time package under the GPL. You are free to choose a plug-in of any license; we don't want to limit your choice. Therefore non-GPL compatible plug-ins are allowed. Note that it's not allowed to distribute a precompiled Lazarus with these non-GPL-compatible plugins included statically; however, we do not see this as a severe limitation, since recompiling Lazarus is easy.
913849
914850## Using the Forum
915851
916852### What is the correct way to ask questions in the forum?
917853
918854First and most important: **always mention which Lazarus version, Free Pascal version, Widgetset, CPU Architecture and Operating System (with full version) that you are using!** Don't just say that you are using "the latest version"; please state the exact version number. For snapshots, the revision number and/or date are also important.
919855
920856When asking a programming question, **always try to include some source code which demonstrates the problem**. Please surround your code with \[code=pascal\]...\[/code\] tags (or use the Insert code button in the forum post editor toolbar). You can attach complete programs as zip files if you want. Use Lazarus/Project/Publish Project to help with that.
921857
922858If you get an error on your code, **always specify what the error is**. Simply copying what the compiler / debugger / your program said should be enough in most cases. If the error happens at runtime, use -gl and disable function inlining when compiling so your program can generate a proper backtrace.
923859
924860Often an image is also very useful. You can host images in <https://imageshack.com/> and other similar websites and then post a link.
925861
926862Try to provide both a high-level overview of the problem (**what goal you want to achieve**) as well as a more detailed view of the problem ('''how are you trying to achieve your goal'. Often, there is a much easier way of getting things done that you may not know about.
927863
928864Finally, make sure you have searched/read the relevant documentation (e.g. the [[FPC documentation]] and Lazarus wiki, see e.g. [[Lazarus Documentation]]. You should also [search the forums](https://forum.lazarus.freepascal.org/index.php?action=search): other people with may already have found solutions to similar problems. If you indicate you have already done a bit of homework, people will in general be much more willing to help.
929865
930866For more tips about asking questions the smart way, read this: <http://catb.org/esr/faqs/smart-questions.html>
931867
932868See also: [[Forum|How to use the forum]]
933869
934870## Version numbering
935871
936872See the [[Version Numbering]] page for an explanation of the branching and version numbering of Lazarus.
937873
938874## Problems/issues with old Lazarus/FPC versions
939875
940876Issues with old Lazarus/FPC versions and notes about upgrading are covered below.
941877
942878Often, the best solution is to upgrade; please see the various [Release Notes](/wiki-category/Release%20Notes)
943879
944880### Why is the linking so slow on Windows (Lazarus \< 0.9.24)?
945881
946882> **Note:** This problem was fixed in FPC 2.2 and Lazarus 0.9.24. Please update your Lazarus if you can. For older versions read text below.
947883
948884Generally speaking, compilation on Windows takes more time then other platforms because the GNU Linker utilized by Free Pascal is slow on this platform. This problem only affects Windows, and is only bad on relatively old computers (less then 1Ghz) and computers with little RAM (128MB or less).
949885
950886Also, if you smartlink LCL the linking will be much slower. A study about this is located here: [[File size and smartlinking]]
951887
952888Starting from FPC 2.2, an internal linker is used which decreases the linking time dramatically.
953889
954890### Old Lazarus does not support Windows-style resources; converting lrs resources
955891
956892Older versions of FPC (and Lazarus based on it) don't support Windows (.rc/.res) resources, but only LRS files (Lazarus Resource files). See [[Lazarus Resources]] Since 0.9.30 Lazarus can use fpc resources. That means you can delete the lrs files for forms and replace the include directives `{$I unit1.lrs}` with `{$R *.lfm}`.
957893
958894### Antivirus
959895
960896Excluding the Lazarus directory (and the directory/directories where your project/projects are) from on access virus scanning may help there.
961897
962898## See also
963899
964900- [[Mac Installation FAQ]] for macOS.
965901- [[Unit not found - How to find units]] information on what to do when you get "unit not found" messages.
966902
967903---
968904*From the Free Pascal wiki, page "Lazarus FAQ", as it stood on 2023-07-15 after a change by JuhaManninen, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).*
969905Category: FAQs
970906Category: Lazarus
971907Category: Troubleshooting

Back to history