Sign in Join
Wiki copytemporary

Lazarus FAQ: what changed

Revision 4 to 5. Removed lines have a minus sign; added lines have a plus sign.

OldNewLine
1-> **Note:** This FAQ may be **outdated** in certain parts.
1+![Light bulb](https://upload.wikimedia.org/wikipedia/commons/d/d8/Nuvola_apps_ktip.png?utm_source=commons.wikimedia.org&utm_campaign=imageinfo&utm_content=original) **Note:** This FAQ may be **outdated** in certain parts.
22
33## General
44
55### What is Lazarus?
66
7-Lazarus 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.
7+Lazarus 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
13-The 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.
13+The 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
17-- 1\. Project\|Compiler Options\|Code\|Smart Linkable (-CX) -\> Checked
18-- 2\. Project\|Compiler Options\|Linking\|Debugging\| Uncheck all except Strip Symbols From Executable (-Xs)
19-- 3\. Project\|Compiler Options\|Linking\|Link Style\|Link Smart (-XX) -\> Checked
17+ * 1\. Project|Compiler Options|Code|Smart Linkable (-CX) -> Checked
18+ * 2\. Project|Compiler Options|Linking|Debugging| Uncheck all except Strip Symbols From Executable (-Xs)
19+ * 3\. Project|Compiler Options|Linking|Link Style|Link Smart (-XX) -> Checked
2020
21-> **Note:** only do this if you don't need to run the debugger. For more details, see [[Size Matters]]
21+![Light bulb](https://upload.wikimedia.org/wikipedia/commons/d/d8/Nuvola_apps_ktip.png?utm_source=commons.wikimedia.org&utm_campaign=imageinfo&utm_content=original) **Note:** only do this if you don't need to run the debugger. For more details, see [[Size Matters]]
2222
23-Lazarus 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.
23+Lazarus 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
25-**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.
25+**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
29-You only need fpc.cfg. This way the compiler knows where to find the libraries.
29+You only need fpc.cfg. This way the compiler knows where to find the libraries.
3030
3131### How do I compile Lazarus?
3232
33-Do something like this:
34-
35-``` bash
33+Do something like this:
34+```
3635cd lazarus
37-make clean all
36+ make clean all
3837```
3938
40-If you want to build Lazarus for different widgetset eg. Qt (supported on Linux, Windows and OSX) then use the LCL_PLATFORM argument:
41-
42-``` bash
39+If you want to build Lazarus for different widgetset eg. Qt (supported on Linux, Windows and OSX) then use the LCL_PLATFORM argument:
40+```
4341cd lazarus
44-make clean all LCL_PLATFORM=qt
42+ make clean all LCL_PLATFORM=qt
4543```
4644
4745### Is it possible to build Lazarus projects without the Lazarus IDE?
4846
4947See [[Using the LCL without Lazarus]]
5048
5149### How do I build other Free Pascal programs that use LCL without the Lazarus IDE?
5250
5351See [[Using the LCL without Lazarus]]
5452
5553### What version of FPC is required?
5654
57-Any 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.
55+Any 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.
5856
59-Lazarus trunk also supports FPC trunk.
57+Lazarus trunk also supports FPC trunk.
6058
61-- Lazarus 1.0.8 requires at least FPC 2.6.2.
62-- Lazarus 1.0 requires at least FPC 2.6.0.
63-- Lazarus 2.x requires at least FPC 3.0.0
64-- Lazarus 3.0 requires at least FPC 3.2.0
59+ * Lazarus 1.0.8 requires at least FPC 2.6.2.
60+ * Lazarus 1.0 requires at least FPC 2.6.0.
61+ * Lazarus 2.x requires at least FPC 3.0.0
62+ * Lazarus 3.0 requires at least FPC 3.2.0
6563
6664### I can't compile Lazarus
6765
68-1. Check if the compiler is the correct version
69-2. Check if the (fpc) libraries are from the same version
70-3. Check if the compiler installation path has spaces in it. Make sure it doesn't!
71-4. Check if you have a fpc.cfg and no old ppc386.cfg
72-5. Check also the OS-dependent FAQs
73-6. If you're still stuck, ask on the forum or Lazarus mailing list
66+ 1. Check if the compiler is the correct version
67+ 2. Check if the (fpc) libraries are from the same version
68+ 3. Check if the compiler installation path has spaces in it. Make sure it doesn't!
69+ 4. Check if you have a fpc.cfg and no old ppc386.cfg
70+ 5. Check also the OS-dependent FAQs
71+ 6. If you're still stuck, ask on the forum or Lazarus mailing list
7472
7573### How to embed a small file in the executable, without the need of a separate file? How to embed a resource?
7674
77-Both Lazarus resource and Windows-type/FPC resources are supported. See [[Lazarus Resources]].
75+Both Lazarus resource and Windows-type/FPC resources are supported. See [[Lazarus Resources]].
7876
7977### What is the meaning of the various file extensions used by Lazarus?
8078
81-The [[Lazarus Tutorial|Lazarus Tutorial#The Lazarus files]] explains some extensions by an example. Here is a brief list:
82-
83-<thead>
84-
85-</thead>
86-<tbody>
87-
88-<code>.pp</code><br />
89-<code>.p</code></td>
90-
91-</tbody>
79+This [[Lazarus Tutorial|page]] explains some extensions by an example. For a more complete list, see [[File extensions]].
9280
9381### Why are TForm.ClientWidth/ClientHeight the same as TForm.Width/Height
9482
95-The 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.
83+The 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.
9684
97-Eventually 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.
85+Eventually 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.
9886
9987## Errors
10088
101-Platform specific errors/problems are also covered in sections below.
89+Platform specific errors/problems are also covered in sections below.
10290
10391### 'Fatal: Circular unit reference between a and b'
10492
105-A 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:
106-
107-This one causes error:
93+A 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:
10894
109-``` pascal
95+This one causes error:
96+```
11097unit a;
111-
112-interface
113-
114-uses b;
115-
116-implementation
117-
118-end.
98+
99+ interface
100+
101+ uses b;
102+
103+ implementation
104+
105+ end.
119106```
120-
121-``` pascal
107+```
122108unit b;
123-
124-interface
125-
126-uses a;
127-
128-implementation
129-
130-end.
109+
110+ interface
111+
112+ uses a;
113+
114+ implementation
115+
116+ end.
131117```
132118
133-But this one doesn't:
134-
135-``` pascal
119+But this one doesn't:
120+```
136121unit a;
137-
138-interface
139-
140-implementation
141-
142-uses b;
143-
144-end.
122+
123+ interface
124+
125+ implementation
126+
127+ uses b;
128+
129+ end.
145130```
146-
147-``` pascal
131+```
148132unit b;
149-
150-interface
151-
152-implementation
153-
154-uses a;
155-
156-end.
133+
134+ interface
135+
136+ implementation
137+
138+ uses a;
139+
140+ end.
157141```
158142
159-In some cases the **minimal base class** method might be suitable.
160-
161-Separate one class into a minimal base class (what the other needs) and derive it for the rest of the implementation.
143+
144+In some cases the **minimal base class** method might be suitable.
162145
163-**unita**: uses unitb
146+Separate one class into a minimal base class (what the other needs) and derive it for the rest of the implementation.
164147
165-``` pascal
166- type
167- ClassA = class(BaseClassA)
168- // rest of ClassA
169- end;
148+
149+**unita** : uses unitb
170150```
171-
172-**unitb**:
173-
174-``` pascal
175- type
176- ClassB = class; //forward declaration
151+type
152+ ClassA = class(BaseClassA)
153+ // rest of ClassA
154+ end;
155+```
177156
178- BaseClassA = class
179- // references ClassB
180- end;
181-
182- ClassB = class
183- // references BaseClassA
184- end;
157+**unitb** :
185158```
159+type
160+ ClassB = class; //forward declaration
161+
162+ BaseClassA = class
163+ // references ClassB
164+ end;
165+
166+ ClassB = class
167+ // references BaseClassA
168+ end;
169+```
186170
187171Discussion: <https://forum.lazarus.freepascal.org/index.php/topic,25667.msg156115.html#msg156115>
188172
189-### 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?
190-
191-The 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.
173+### 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?
192174
193-``` pascal
175+The TControl class has a [Text](<http://lazarus-ccr.sourceforge.net/docs/lcl/controls/tcontrol.text.html> "doc:lcl/controls/tcontrol.text.html") property. In a method of a form, that has higher visibility, the [Text](<http://lazarus-ccr.sourceforge.net/docs/rtl/system/text.html> "doc:rtl/system/text.html") type from the system unit. You can use the [TextFile](<http://lazarus-ccr.sourceforge.net/docs/rtl/system/textfile.html> "doc:rtl/system/textfile.html") type, which is just an alias for the Text type or you can add the unit to the type definition.
176+```
194177var
195- MyTextFile: TextFile;
196- MyText: System.Text;
178+ MyTextFile: TextFile;
179+ MyText: System.Text;
197180```
198181
199-A 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*.
182+A similar name clash exists with assigning and closing a text file. TForm has a _assign_ and a [Close](<http://lazarus-ccr.sourceforge.net/docs/lcl/forms/tcustomform.close.html> "doc:lcl/forms/tcustomform.close.html") method. You can use [AssignFile](<http://lazarus-ccr.sourceforge.net/docs/rtl/objpas/assignfile.html> "doc:rtl/objpas/assignfile.html") and [CloseFile](<http://lazarus-ccr.sourceforge.net/docs/rtl/objpas/closefile.html> "doc:rtl/objpas/closefile.html") or add the unit name _System_.
200183
201184### I get an error when using Printer.BeginDoc
202185
203-The 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.
204-
205-If 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.
186+The 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.
206187
207-If you used the default installation directories \[lazarus installed directory\] is:
188+If 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.
208189
209-| Operating system | Lazarus installed directory |
210-|------------------|-----------------------------|
211-| FreeBSD | /usr/local/share/lazarus |
212-| Linux | /usr/lib/lazarus |
213-| macOS | /Library/Lazarus/ |
214-| Windows | c:\lazarus |
190+If you used the default installation directories [lazarus installed directory] is:
215191
216-The same solution also applies to the exception you can get when referencing *Printer.Printers*.
192+Operating system | Lazarus installed directory
193+---|---
194+FreeBSD | /usr/local/share/lazarus
195+Linux | /usr/lib/lazarus
196+macOS | /Library/Lazarus/
197+Windows | c:\lazarus
198+
199+The same solution also applies to the exception you can get when referencing _Printer.Printers_.
217200
218201### When I try to compile a project, I get an error message "Cannot find Unit ..."
219202
220203Please see [[Unit not found - How to find units]]
221204
222-For information on the error "Cannot find unit interfaces", see the next section.
205+For information on the error "Cannot find unit interfaces", see the next section.
223206
224207### When I try to compile a project, I get an error message "Cannot find Unit interfaces"
225208
226-This 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.
209+This 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.
227210
228-The 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.
211+The 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.
229212
230-It is normal to have multiple versions of interfaces.ppu (in the proper directories) to allow compiling with different widgets.
213+It is normal to have multiple versions of interfaces.ppu (in the proper directories) to allow compiling with different widgets.
231214
232-If 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.
215+If 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.
233216
234-You can do one of the following:
217+You can do one of the following:
235218
236-1. 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!
237-2. 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.
238-3. 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.
219+ 1. 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!
220+ 2. 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.
221+ 3. 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.
239222
240223### When I compile a project, that uses a LCL unit, I get a linker error
241224
242-Here is an example for such a linker error:
243-
244-`` /path/to/lazarus/lcl/units/x86_64-linux/wsimglist.o: In function `REGISTERCUSTOMIMAGELIST': ``\
245-`` /path/to/lazarus/lcl//widgetset/wsimglist.pp:266: undefined reference to `WSRegisterCustomImageList' ``
225+Here is an example for such a linker error:
226+```
227+/path/to/lazarus/lcl/units/x86_64-linux/wsimglist.o: In function `REGISTERCUSTOMIMAGELIST':
228+ /path/to/lazarus/lcl//widgetset/wsimglist.pp:266: undefined reference to `WSRegisterCustomImageList'
229+```
246230
247-- Make sure yor project uses the package LCL. You can check this in the project inspector.
248-- Make sure unit "interfaces" is used as one of the first units of your program.
231+ * Make sure yor project uses the package LCL. You can check this in the project inspector.
232+ * Make sure unit "interfaces" is used as one of the first units of your program.
249233
250-> **Note:** These functions are implemented by the LCL backends. By adding the unit interfaces, you link a LCL backend into your program.
234+![Light bulb](https://upload.wikimedia.org/wikipedia/commons/d/d8/Nuvola_apps_ktip.png?utm_source=commons.wikimedia.org&utm_campaign=imageinfo&utm_content=original) **Note:** These functions are implemented by the LCL backends. By adding the unit interfaces, you link a LCL backend into your program.
251235
252-### At the line :{\$R *.DFM} How can I solve this problem (Lazarus with FPC \< 2.4.0)?
236+### At the line :{$R *.DFM} How can I solve this problem (Lazarus with FPC < 2.4.0)?
253237
254-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 (.dfm files) if you use the following steps:
238+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 (.dfm files) if you use the following steps:
255239
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.
257-- Create a file with lazres (in lazarus/tools) lazres yourform.lrs yourform.lfm
258-- Add the following initialization section to
240+ * 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.
241+ * Create a file with lazres (in lazarus/tools) lazres yourform.lrs yourform.lfm
242+ * Add the following initialization section to
259243
260-``` pascal
244+```
261245initialization
262-{$I yourform.lrs}
246+ {$I yourform.lrs}
263247```
264248
265-Please keep in mind that not all properties in the dfm are supported yet by Lazarus, so you might get a crash.
249+Please keep in mind that not all properties in the dfm are supported yet by Lazarus, so you might get a crash.
266250
267-Edit: 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.
251+Edit: 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.
268252
269253### 'Identifier not found LazarusResources'
270254
271-When 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.
255+When 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.
272256
273-### When accessing events of objects, *e.g.*, the onclick event of a button, I get the following error. ERROR unit not found: stdCtrls
257+### When accessing events of objects, _e.g._ , the onclick event of a button, I get the following error. ERROR unit not found: stdCtrls
274258
275-Make sure, in the Project -\> Project Inspector, that your project depends on the package "LCL" and that you have installed the FPC sources.
259+Make sure, in the Project -> Project Inspector, that your project depends on the package "LCL" and that you have installed the FPC sources.
276260
277-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.
261+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.
278262
279-The FPC source path can be set via: Environment -\> Environment Options -\> Files -\> FPC source directory
263+The FPC source path can be set via: Environment -> Environment Options -> Files -> FPC source directory
280264
281265### 'Fatal: Internal error XXXXYYZZW'
282266
283-An 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.
267+An 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.
284268
285-=== Fatal: Cannot find \[...\] used by \[...\], incompatible ppu=\[filename\], package \[package name\] ===
269+### Fatal: Cannot find [...] used by [...], incompatible ppu=[filename], package [package name]
286270
287-When 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".''
271+When 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".__
288272
289-Explanation: FPC cannot use this ppu for one of these reasons:
273+Explanation: FPC cannot use this ppu for one of these reasons:
290274
291-- it was compiled with another FPC version;
292-- it was compiled with (depends on) some other ppu files that are not in the search path;
293-- you misconfigured some search path(s).
275+ * it was compiled with another FPC version;
276+ * it was compiled with (depends on) some other ppu files that are not in the search path;
277+ * you misconfigured some search path(s).
294278
295-Without knowing how you installed FPC + Lazarus, I'd be tempted to delete both and start again (make sure to delete the fpc.cfg file).
279+Without knowing how you installed FPC + Lazarus, I'd be tempted to delete both and start again (make sure to delete the fpc.cfg file).
296280
297281### Lazarus cannot open a project if last character of the path to it is a space
298282
299-If 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`.
283+If 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`.
300284
301-This 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.
285+This 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.
302286
303287### strToFloat - EConvertError: "0.nnn" is an invalid float
304288
305-The "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.
289+The "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 preferred solution is to use the overlaoded version of strToFloat which accepts a TFormatSettings parameter. You could also add this to your code: `DefaultFormatSettings.decimalSeparator := '.';` to override your locale's decimal separator. Notice however that (at least on Windows) this could be set back to your locale's default in respons to a `WM_SETTINGCHANGE` message that is broadcasted. Alternatively, instead of strToFloat and floatToStr, use the Pascal intrinsics val and str - they always need a decimal point.
306290
307291## Debugger
308292
309-*See also [[GDB Debugger Tips]].*
293+_See also[[GDB Debugger Tips]]._
310294
311295### How do I set up/configure for debugging
312296
313297[[Debugger Setup|Setup the debugger]]
314298
315299### How can I inspect properties?
316300
317-You have to use FPC 2.4 or newer.
301+You have to use FPC 2.4 or newer.
318302
319-If you compile your application using -gw (dwarf debug info), you should be able to inspect properties.
303+If you compile your application using -gw (dwarf debug info), you should be able to inspect properties.
320304
321-> **Note:** This is only true for properties that map directly to a variable (the "read" declaration points to a member, not a function).
305+![Light bulb](https://upload.wikimedia.org/wikipedia/commons/d/d8/Nuvola_apps_ktip.png?utm_source=commons.wikimedia.org&utm_campaign=imageinfo&utm_content=original) **Note:** This is only true for properties that map directly to a variable (the "read" declaration points to a member, not a function).
322306
323-If 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.
307+If 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.
324308
325-The optional ability to explicitly inspect the results of functions (with the risks described), and therefore calling code from the debugger is not yet implemented
309+The optional ability to explicitly inspect the results of functions (with the risks described), and therefore calling code from the debugger is not yet implemented
326310
327311### Why does the debugger not show some Variables/Structures ("no such symbol"/"incomplete type")
328312
329-For problems debugging:
313+For problems debugging:
330314
331-- properties
332-- Array of ... (Dynamic Array)
333-- Variables in Nested Procedures
334-- "no such symbol in context"
335-- "incomplete type"
315+ * properties
316+ * Array of ... (Dynamic Array)
317+ * Variables in Nested Procedures
318+ * "no such symbol in context"
319+ * "incomplete type"
336320
337321Please see [[GDB Debugger Tips]] and the and [[FpDebug|FpDebug#Properties]]
338322
339323### How can I debug FCL components from packages with Lazarus
340324
341-FCL 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.
342-
343-This 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.
344-
345-Before 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:
325+FCL 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.
346326
347-`-Fu/usr/local/lib/fpc/$fpcversion/units/$fpctarget/*`
327+This 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.
348328
349-Make 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.
329+Before 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:
330+```
331+-Fu/usr/local/lib/fpc/$fpcversion/units/$fpctarget/*
332+```
350333
351-1. Open a shell terminal
352-2. cd /user/local/share/src/fpc-2.3.1/fpc/fcl-db/
353-3. sudo make clean all install INSTALL_PREFIX=/usr/local OPT=-gl
334+Make 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.
354335
355-> **Note:** INSTALL_PREFIX parameter should be properly configured for units to be installed.
336+ 1. Open a shell terminal
337+ 2. cd /user/local/share/src/fpc-2.3.1/fpc/fcl-db/
338+ 3. sudo make clean all install INSTALL_PREFIX=/usr/local OPT=-gl
356339
357-In the sample below /usr/local is a default fpc path for Linux, but may vary on other OSes.
340+![Light bulb](https://upload.wikimedia.org/wikipedia/commons/d/d8/Nuvola_apps_ktip.png?utm_source=commons.wikimedia.org&utm_campaign=imageinfo&utm_content=original) **Note:** INSTALL_PREFIX parameter should be properly configured for units to be installed.
358341
359-``` bash
342+In the sample below /usr/local is a default fpc path for Linux, but may vary on other OSes.
343+```
360344make clean all install INSTALL_PREFIX=/usr/local OPT=-gl
361345```
362346
363-Finally, after rebuilding any FCL units you may want to rebuild LCL as well.
347+Finally, after rebuilding any FCL units you may want to rebuild LCL as well.
364348
365349### Problems with GDB on Mac
366350
367-Lazarus has now support for lldb on Mac. See [[Installing Lazarus on macOS|Configuring the lldb debugger]].
351+Lazarus has now support for lldb on Mac. See [[Installing Lazarus on macOS|Configuring the lldb debugger]].
368352
369353If you want to use gdb, you can find some info here: [[GDB Debugger Tips|GDB tips for Mac]]
370354
371355### How can I use a log file for debugging?
372356
373-Lazarus provides a basic log framework (style [[DebugLn|debugln(...)]] ) in the unit [[LazLogger]]. See that page for more details.
357+Lazarus provides a basic log framework (style [[DebugLn|`debugln(...)`]] ) in the unit [[LazLogger]]. See that page for more details.
374358
375359### How can I use a Log-file for debugging the IDE itself?
376360
377-Lazarus itself uses [[LazLogger]].
378-
379-This means that you can run Lazarus with
361+Lazarus itself uses [[LazLogger]].
380362
381-``` bash
363+This means that you can run Lazarus with
364+```
382365--debug-log=lazarusdebuglog.txt
383366```
384367
385-If 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.
368+If 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.
386369
387-If you want output on a console (most useful for Windows), add the option **-WC** in the Tools / Configure "Build Lazarus" options. Then rebuild Lazarus.
370+If you want output on a console (most useful for Windows), add the option **-WC** in the Tools / Configure "Build Lazarus" options. Then rebuild Lazarus.
388371
389372See also [[Console Mode Pascal|Console Mode Pascal#Run in IDE with redirected output]]
390373
391374## Contributing / Making Changes to Lazarus
392375
393-### I created a Patch to dock the IDE Messages form on the "Source Code Editor" form (at bottom)
394-
395-Such 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,
396-
397-`+-------------------++--+`\
398-`|menu               ||  |`\
399-`+-------------------+|  |`\
400-`+--++---------------+|  |`\
401-`|PI|| Source Editor ||CE|`\
402-`+--+|               ||  |`\
403-`+--+|               ||  |`\
404-`|  |+---------------++--+`\
405-`|OI|+-------------------+`\
406-`|  ||messages           |`\
407-`+--++-------------------+`
408-
409-The 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.
410-
411-An example for such a dock manager is the package [[anchordockdsgn]]
412-
413376### I have fixed/improved Lazarus. How can I add my changes to the official Lazarus source?
414377
415-Create a patch and send it to the developers. For details, see [[Creating A Patch]].
378+Create a patch and send it to the developers. For details, see [[Creating A Patch]].
416379
417380### How can I install more than one copy of Lazarus?
418381
419382Please see [[Multiple Lazarus]]
420383
421384### How can I become a Lazarus developer and access management in the SVN and bug-tracker?
422385
423-First 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/).
386+First 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/>).
424387
425388## Where is ... defined
426389
427390### Virtual key constants
428391
429-Virtual key constants are defined in [[doc:lcl/lcltype|LCLType]]. Add LCLtype to your uses.
392+Virtual key constants are defined in [LCLType](<http://lazarus-ccr.sourceforge.net/docs/lcl/lcltype> "doc:lcl/lcltype"). Add LCLtype to your **uses**.
430393
431394## Using the IDE
432395
433396### How can I use "identifier completion"?
434397
435-You 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.
398+You 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.
436399
437400### Can I change the code editor font and colours?
438401
439-Yes, 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)
402+Yes, 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)
440403
441404### How can I disable specific compiler warning messages?
442405
443-To 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).
406+To 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>).
444407
445408### What are the IDE command line options?
446409
447-See [[Lazarus command line options]].
410+See [[Lazarus command line options]].
448411
449412## Linux
450413
451414### Typing in edit fields generate duplicate letters
452415
453-This is more likely to happen under Ubuntu and Ubunto derived distros, and with GNOME Desktop but other distros/Desktop environments can be affected too.
416+This is more likely to happen under Ubuntu and Ubunto derived distros, and with GNOME Desktop but other distros/Desktop environments can be affected too.
454417
455-The problem is originated by bugs in the ibus Input Method System. Unfortunately Ibus is the default input method of GNOME desktop.
418+The problem is originated by bugs in the ibus Input Method System. Unfortunately Ibus is the default input method of GNOME desktop.
456419
457-If 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.
420+If 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.
458421
459-In order to do that you have a number of options, namely:
422+In order to do that you have a number of options, namely:
460423
461-- 1 - Disable (or set to "none") the Input Method in System Settings-\>Preferences-\>Input Method
424+ * 1 - Disable (or set to "none") the Input Method in System Settings->Preferences->Input Method
462425
463-- 2 - Add the three following lines in /etc/profile (system wide)
426+ * 2 - Add the three following lines in /etc/profile (system wide)
464427
465-`export GTK_IM_MODULE=gtk-im-context-simple`\
466-`export QT_IM_MODULE=simple`\
467-`export XMODIFIERS=@im=none`
428+```
429+export GTK_IM_MODULE=gtk-im-context-simple
430+ export QT_IM_MODULE=simple
431+ export XMODIFIERS=@im=none
432+```
468433
469-- 3 - Add a file named *input_method.sh* containing just the 3 lines above in /etc/profile.d (system wide)
434+ * 3 - Add a file named _input_method.sh_ containing just the 3 lines above in /etc/profile.d (system wide)
470435
471-- 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.
436+ * 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.
472437
473-- 5 - Create a Lazarus launching script containing the same 3 lines. (affects only Lazarus)
438+ * 5 - Create a Lazarus launching script containing the same 3 lines. (affects only Lazarus)
474439
475-Methods 1 and 2 may not survive after a system update, while 3,4 and 5 will.
440+Methods 1 and 2 may not survive after a system update, while 3,4 and 5 will.
476441
477-Be 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.
442+Be 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.
478443
479-You may find more information about Input Methods, and how to deal with them in:
444+You may find more information about Input Methods, and how to deal with them in:
480445
481-<https://fedoraproject.org/wiki/I18N/InputMethods> (This is Fedora specific but most informations apply in general)
446+<https://fedoraproject.org/wiki/I18N/InputMethods> (This is Fedora specific but most informations apply in general)
482447
483-<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)
448+<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)
484449
485450### How can I debug on Linux without the IDE?
486451
487-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:
488-
489-``` bash
452+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:
453+```
490454make clean; make OPT=-dDEBUG
491-ddd lazarus
455+ ddd lazarus
492456```
493457
494-Be 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.
458+Be 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.
495459
496460### I can debug now but ddd does not find my sources or complains that they contain no code. What's that?
497461
498-This is a path-related problem with either gdb or ddd. You can avoid this by
499-
500-- 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.
501-- In ddd goto \[Edit\] \[gdb-settings\] and set the search-path
502-- Create a \$(HOME)/.gdbinit file like:
503-
504-`     directory /your/path/to/lazarus`\
505-`     directory /your/path/to/lazarus/lcl`\
506-`     directory /your/path/to/lazarus/lcl/include`
507-
508-### I receive an error during the linking that states /usr/bin/ld: cannot find -l\<some lib\>
462+This is a path-related problem with either gdb or ddd. You can avoid this by
509463
510-For example:
464+ * 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.
465+ * In ddd goto [Edit] [gdb-settings] and set the search-path
466+ * Create a $(HOME)/.gdbinit file like:
511467
512-` /usr/bin/ld: cannot find -lgdk`
468+```
469+directory /your/path/to/lazarus
470+ directory /your/path/to/lazarus/lcl
471+ directory /your/path/to/lazarus/lcl/include
472+```
513473
514-This 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'.
474+### I receive an error during the linking that states /usr/bin/ld: cannot find -l<some lib>
515475
516-**Package Based Distributions**
517-You 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).
476+For example:
477+```
478+/usr/bin/ld: cannot find -lgdk
479+```
518480
519-
520-Some distributions have commands to find which package contains a file:
481+This 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'.
521482
522-**Mandriva**
483+**Package Based Distributions**
484+ You 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).
523485
524-``` bash
486+ Some distributions have commands to find which package contains a file:
487+ **Mandriva**
488+```
525489urpmf lib<somelib>.so
526490```
527491
528-
529-will list all packages containing the file named lib\<somelib\>.so, you'll have to install those ending in -devel
530-
531-
532-**Debian**
492+ will list all packages containing the file named lib<somelib>.so, you'll have to install those ending in -devel
533493
534-
535-install the apt-file utility (apt-get install apt-file) then
494+ **Debian**
536495
537-``` bash
496+ install the apt-file utility (apt-get install apt-file) then
497+```
538498apt-file search lib<somelib>.so
539499```
540500
541-
542-will list all packages containing the file named lib\<somelib\>.so, you'll have to install those ending in -dev
543-
544-
545-**SuSE**
501+ will list all packages containing the file named lib<somelib>.so, you'll have to install those ending in -dev
546502
547-
548-SuSE 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).
503+ **SuSE**
549504
550-**Source Based Distributions and Manual Compilation (LFS)**
551-Make 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).
505+ SuSE 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).
552506
553-
554-**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:
507+**Source Based Distributions and Manual Compilation (LFS)**
508+ Make 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).
555509
556-``` bash
510+ **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:
511+```
557512# as root
558-cd /usr/local/lib && ln -s libglib-12.so libglib12.so
559-cd /usr/X11R6/lib && ln -s libgtk-12.so libgtk12.so
560-cd /usr/X11R6/lib && ln -s libgdk-12.so libgdk12.so
513+ cd /usr/local/lib && ln -s libglib-12.so libglib12.so
514+ cd /usr/X11R6/lib && ln -s libgtk-12.so libgtk12.so
515+ cd /usr/X11R6/lib && ln -s libgdk-12.so libgdk12.so
561516```
562517
563-
564-**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
518+ **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
565519
566-
567-**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"
520+ **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"
568521
569522### I receive a warning during the linking that states: Warning: "crtbeginS.o" (or "crtendS.o") not found
570523
571-The actual filename may also be "crtbegin.o" or "crtend.o"\
572-In most cases linking will not fail.\
573-Here'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):
574-
575-``` bash
524+The actual filename may also be "crtbegin.o" or "crtend.o"
525+In most cases linking will not fail.
526+Here'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):
527+```
576528bart@simenon ~ $ gcc --print-file-name crtbeginS.o
577-/usr/lib/gcc/x86_64-linux-gnu/5/crtbeginS.o
529+ /usr/lib/gcc/x86_64-linux-gnu/5/crtbeginS.o
578530```
579531
580-Add the path into fpc.cfg:
581-
582-`# path to the gcclib`\
583-`#ifdef cpui386`\
584-`#-Fl/usr/lib/gcc/x86_64-linux-gnu/5  if you have a 32-bit fpc: fill in the correct path here`\
585-`#endif`\
586-`#ifdef cpux86_64`\
587-`-Fl/usr/lib/gcc/x86_64-linux-gnu/5`\
588-`#endif`
532+Add the path into fpc.cfg:
533+```
534+# path to the gcclib
535+ #ifdef cpui386
536+ #-Fl/usr/lib/gcc/x86_64-linux-gnu/5 if you have a 32-bit fpc: fill in the correct path here
537+ #endif
538+ #ifdef cpux86_64
539+ -Fl/usr/lib/gcc/x86_64-linux-gnu/5
540+ #endif
541+```
589542
590-Note: On Linux the default (external) linker is ld. This is part of the linux distribution and not part of, or built with, FreePascal.
543+Note: On Linux the default (external) linker is ld. This is part of the linux distribution and not part of, or built with, FreePascal.
591544
592545### How can I convert a Kylix 2 project into a Lazarus project?
593546
594-Nearly the same way as converting a Kylix project into a Delphi/VCL project.
547+Nearly the same way as converting a Kylix project into a Delphi/VCL project.
595548
596-The 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:
549+The 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:
597550
598-- Rename all used CLX Q-units like QForms, QControls, QGraphics, ... into their VCL counterparts: Forms, Controls, Graphics, ...
599-- Add LResources to the uses section of every form source
600-- Rename or copy all .xfm files to .lfm files.
601-- Rename or copy .dpr file to .lpr file.
602-- Add "Interfaces" to the uses section in the .lpr file.
603-- Remove {\$R *.res} directive
604-- Remove {\$R *.xfm} directive
605-- Add {\$mode objfpc}{\$H+} or {\$mode delphi}{\$H+} directive to .pas and .lpr files
606-- Add an initialization section to the end of each form source and add an include directive for the .lrs file (Lazarus resource file):
551+ * Rename all used CLX Q-units like QForms, QControls, QGraphics, ... into their VCL counterparts: Forms, Controls, Graphics, ...
552+ * Add LResources to the uses section of every form source
553+ * Rename or copy all .xfm files to .lfm files.
554+ * Rename or copy .dpr file to .lpr file.
555+ * Add "Interfaces" to the uses section in the .lpr file.
556+ * Remove {$R *.res} directive
557+ * Remove {$R *.xfm} directive
558+ * Add {$mode objfpc}{$H+} or {$mode delphi}{$H+} directive to .pas and .lpr files
559+ * Add an initialization section to the end of each form source and add an include directive for the .lrs file (Lazarus resource file):
607560
608-``` pascal
561+```
609562initialization
610-{$I unit1.lrs}
563+ {$I unit1.lrs}
611564```
612565
613-
614-The .lrs files can be created via the lazres tool in: (lazarusdir)/tools/lazres.
615-
616-For example: ./lazres unit1.lrs unit1.lfm
566+ The .lrs files can be created via the lazres tool in: (lazarusdir)/tools/lazres.
567+ For example: ./lazres unit1.lrs unit1.lfm
617568
618-- Fix the differences. The LCL does not yet support every property of the VCL and the CLX is not fully VCL compatible.
569+ * Fix the differences. The LCL does not yet support every property of the VCL and the CLX is not fully VCL compatible.
619570
620-- 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)
571+ * 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)
621572
622573### When compiling lazarus the compiler can not find a unit. e.g.: gtkint.pp(17,16) Fatal: Can't find unit GLIB
623574
624-1\. Check a clean rebuild: do a 'make clean all'
625-
626-2\. Check if the compiler has the correct version (2.0.4 or higher)
627-
628-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.
629-
630-
631-**Hint:** You can see which config file is used with 'ppc386 -vt bogus'
632-
633-Remove any ppc386.cfg as it is really obsolete.
634-
635-4\. Check if the config file (/etc/fpc.cfg) contains the right paths to your fpc libs. There must be three lines like this:
575+1\. Check a clean rebuild: do a 'make clean all'
636576
637-`   -Fu/usr/lib/fpc/$fpcversion/units/$fpctarget`\
638-`   -Fu/usr/lib/fpc/$fpcversion/units/$fpctarget/rtl`\
639-`   -Fu/usr/lib/fpc/$fpcversion/units/$fpctarget/*`
577+2\. Check if the compiler has the correct version (2.0.4 or higher)
640578
641-
642-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/... .
579+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.
643580
644-**Hint:** You can see your searchpaths with 'ppc386 -vt bogus'
581+ **Hint:** You can see which config file is used with 'ppc386 -vt bogus'
582+ Remove any ppc386.cfg as it is really obsolete.
645583
646-5\. Check that the config file (/etc/fpc.cfg) does not contain search paths to the lcl source files (.pp, .pas):
584+4\. Check if the config file (/etc/fpc.cfg) contains the right paths to your fpc libs. There must be three lines like this:
585+```
586+-Fu/usr/lib/fpc/$fpcversion/units/$fpctarget
587+ -Fu/usr/lib/fpc/$fpcversion/units/$fpctarget/rtl
588+ -Fu/usr/lib/fpc/$fpcversion/units/$fpctarget/*
589+```
647590
648-` forbidden: -Fu(lazarus_source_directory)/lcl`\
649-` forbidden: -Fu(lazarus_source_directory)/lcl/interfaces/gtk`
591+ 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/... .
592+ **Hint:** You can see your searchpaths with 'ppc386 -vt bogus'
650593
651-
652-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:
594+5\. Check that the config file (/etc/fpc.cfg) does not contain search paths to the lcl source files (.pp, .pas):
595+```
596+forbidden: -Fu(lazarus_source_directory)/lcl
597+ forbidden: -Fu(lazarus_source_directory)/lcl/interfaces/gtk
598+```
653599
654-` -Fu(lazarus_source_directory)/lcl/units/$fpctarget`\
655-` -Fu(lazarus_source_directory)/lcl/units/$fpctarget/gtk`
600+ 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:
601+```
602+-Fu(lazarus_source_directory)/lcl/units/$fpctarget
603+ -Fu(lazarus_source_directory)/lcl/units/$fpctarget/gtk
604+```
656605
657-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/\$fpcversion/units/i386-linux/gtk/. If it does not exists, the fpc lib is corrupt and should be reinstalled.
606+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/$fpcversion/units/i386-linux/gtk/. If it does not exists, the fpc lib is corrupt and should be reinstalled.
658607
659-7\. 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.
608+7\. 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.
660609
661-8\. If you are still not succeeded try to use samplecfg script as follows:
610+8\. If you are still not succeeded try to use samplecfg script as follows:
662611
663-*\#* cd /usr/lib/fpc/*version*/
612+_#_ cd /usr/lib/fpc/_version_ /
664613
665-*\#* sudo ./samplecfg /usr/lib/fpc/*\\\$version* /etc
614+_#_ sudo ./samplecfg /usr/lib/fpc/_\$version_ /etc
666615
667-> **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`.
616+![Light bulb](https://upload.wikimedia.org/wikipedia/commons/d/d8/Nuvola_apps_ktip.png?utm_source=commons.wikimedia.org&utm_campaign=imageinfo&utm_content=original) **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`.
668617
669618### I have installed the binary version, but when compiling a simple project, Lazarus gives: Fatal: Can't find unit CONTROLS
670619
671-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:
672-
673-``` bash
620+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:
621+```
674622bash
675-svn checkout http://svn.freepascal.org/svn/lazarus/trunk lazarus
676-cd lazarus
677-make clean all
623+ svn checkout http://svn.freepascal.org/svn/lazarus/trunk lazarus
624+ cd lazarus
625+ make clean all
678626```
679627
680-Make sure that Lazarus get the new source directory: Environment-\>General Options-\>Files-\>Lazarus Directory Top
628+Make sure that Lazarus get the new source directory: Environment->General Options->Files->Lazarus Directory Top
681629
682630### Lazarus compiles, but linking fails with: libgdk-pixbuf not found
683631
684-Install the gdk-pixbuf library for gtk1.x:
632+Install the gdk-pixbuf library for gtk1.x:
685633
686-Where to find the gdk-pixbuf library:
634+Where to find the gdk-pixbuf library:
687635
688-RPMs: <https://rpmfind.net/linux/rpm2html/search.php?query=gdk-pixbuf&submit=Search+>...&system=&arch=
636+RPMs: [https://rpmfind.net/linux/rpm2html/search.php?query=gdk-pixbuf&submit=Search+...&system=&arch=](<https://rpmfind.net/linux/rpm2html/search.php?query=gdk-pixbuf&submit=Search+...&system=&arch=>)
689637
690-Debian packages: libgdk-pixbuf-dev
638+Debian packages: libgdk-pixbuf-dev
691639
692640Sources: <ftp://ftp.gnome.org/pub/gnome/unstable/sources/gdk-pixbuf/>
693641
694642**Ubuntu 8.10:**
695643
696-If 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:
697-
698-``` bash
644+If 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:
645+```
699646apt-get install libgtk2.0-dev
700647```
701648
702649### I have SuSE and I get /usr/bin/ld: cannot find -lgtk Error: Error while linking
703650
704-Older 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).
651+Older 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).
705652
706653### I have Kubuntu and I get /usr/bin/ld: cannot find -lgtk-x11-2.0
707654
708-You can either use the QT or the GTK2 backend. Default is GTK2. For GTK2 install the kubuntu package *libgtk2.0-dev*.
655+You can either use the QT or the GTK2 backend. Default is GTK2. For GTK2 install the kubuntu package _libgtk2.0-dev_.
709656
710657### Lazarus crashes with runtime error 211 after I installed a component
711658
712-After I installed a component, Lazarus crashes with the following message:
713-
714-`Threading has been used before cthreads was initialized.`\
715-`Make cthreads one of the first units in your uses clause.`\
716-`Runtime error 211 at $0066E188`
659+After I installed a component, Lazarus crashes with the following message:
660+```
661+Threading has been used before cthreads was initialized.
662+ Make cthreads one of the first units in your uses clause.
663+ Runtime error 211 at $0066E188
664+```
717665
718-How can I fix this?
666+How can I fix this?
719667
720-Your 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:
668+Your 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:
721669
722-1\) 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.
670+1) 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.
723671
724-2\) 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.
672+2) 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.
725673
726-*Hint:* Maybe your old (non-crashing) Lazarus executable is stored as lazarus.old in the same directory as the crashing Lazarus executable.
674+_Hint:_ Maybe your old (non-crashing) Lazarus executable is stored as lazarus.old in the same directory as the crashing Lazarus executable.
727675
728676See also [[Multithreaded Application Tutorial|Multithreaded Application Tutorial#Units needed for a multithreaded application]]
729677
730678### When I run a program with threads I get runtime error 232
731679
732-The complete error message is:
733-
734-`This binary has no thread support compiled in.`\
735-`Recompile the application with a thread-driver in the program uses`\
736-`clause before other units using thread.`\
737-`Runtime error 232`
680+The complete error message is:
681+```
682+This binary has no thread support compiled in.
683+ Recompile the application with a thread-driver in the program uses
684+ clause before other units using thread.
685+ Runtime error 232
686+```
738687
739-**Solution**: Add cthreads as first unit to the uses clause of your main program, usually the .lpr-file.
688+**Solution** : Add cthreads as first unit to the uses clause of your main program, usually the .lpr-file.
740689
741690### I have Ubuntu Breezy/Mandriva KDE3 and my fonts in Lazarus IDE look too big
742691
743-If 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:
744-
745-`style "default-text" {`\
746-`       fontset = "-*-arial-medium-r-normal--*-100-*-*-*-*-iso8859-1,\`\
747-`                  -*-helvetica-medium-r-normal--*-100-*-*-*-*-*-*"`\
748-`}`\
749-
750-`class "GtkWidget" style "default-text"`
692+If 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:
693+```
694+style "default-text" {
695+ fontset = "-*-arial-medium-r-normal--*-100-*-*-*-*-iso8859-1,\
696+ -*-helvetica-medium-r-normal--*-100-*-*-*-*-*-*"
697+ }
698+
699+ class "GtkWidget" style "default-text"
700+```
751701
752-If 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.
702+If 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.
753703
754704### How can my gtk programs use custom rc files?
755705
756-Option a) Name the rc file *yourprogram.gtkrc* and put it in the same directory where the executable is.
706+Option a) Name the rc file _yourprogram.gtkrc_ and put it in the same directory where the executable is.
757707
758-Option b) Use unit *GtkInt* and call *GTKWidgetSet.SetRCFilename('your_preferred_rc_file');* Best done before *Application.Initialize* in the .lpr file with *{\$IFDEF LCLGtk}*.
708+Option b) Use unit _GtkInt_ and call _GTKWidgetSet.SetRCFilename('your_preferred_rc_file');_ Best done before _Application.Initialize_ in the .lpr file with _{$IFDEF LCLGtk}_.
759709
760-Option c) Use unit *gtk2* and call *gtk_rc_parse('your_rc_file'));* and *gtk_rc_reparse_all;*.
710+Option c) Use unit _gtk2_ and call _gtk_rc_parse('your_rc_file'));_ and _gtk_rc_reparse_all;_.
761711
762712### I have Ubuntu and I cannot compile for Gtk2 due to missing libraries
763713
764-Ubuntu 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:
765-
766-``` bash
714+Ubuntu 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:
715+```
767716cd /usr/lib
768-sudo ln -s libgdk-x11-2.0.so.0 libgtk-x11-2.0.so
717+ sudo ln -s libgdk-x11-2.0.so.0 libgtk-x11-2.0.so
769718```
770719
771-Make sure that the \[whatever\].so symbolic links are created and point to the actual libraries.
720+Make sure that the [whatever].so symbolic links are created and point to the actual libraries.
772721
773722### Lazarus runs differently with Linux vs. Windows. What do I need to know?
774723
775-If 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!
724+If 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!
776725
777-Because Linux is case sensitive you will need to take care that you pay attention to case when referencing or accessing files.
726+Because Linux is case sensitive you will need to take care that you pay attention to case when referencing or accessing files.
778727
779728## Windows
780729
781730### When I cycle/rebuild the compiler, I get
782731
783-#### The name specified is not recognized as an internal or external command, operable program or batch file.\>& was unexpected at this time
784-
785-In 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.
732+#### The name specified is not recognized as an internal or external command, operable program or batch file.>& was unexpected at this time
786733
787-#### make\[3\]: ./ppc1.exe: Command not found
734+In 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.
788735
789-Somehow make has lost its path (reason unknown). Try to cycle with a basedir set like:
736+#### make[3]: ./ppc1.exe: Command not found
790737
791-```dos
738+Somehow make has lost its path (reason unknown). Try to cycle with a basedir set like:
739+```
792740make cycle BASEDIR=your_fpc_source_dir_herecompiler
793741```
794742
795743### When I try to make Lazarus I get:
796744
797-#### make.exe: * * * interfaces: No such file or directory (ENOENT). Stop.make.exe: * * * \[interfaces_all\] Error 2
745+#### make.exe: * * * interfaces: No such file or directory (ENOENT). Stop.make.exe: * * * [interfaces_all] Error 2
798746
799-You need to upgrade your make.
747+You need to upgrade your make.
800748
801749#### makefile:27: *** You need the GNU utils package to use this Makefile. Stop.
802750
803-Make sure you didn't install FPC in a path with spaces in the name. The Makefile doesn't support it.
751+Make sure you didn't install FPC in a path with spaces in the name. The Makefile doesn't support it.
804752
805753### How can I give my program an XP look like Lazarus has?
806754
807-Project -\> Project Options -\> Check 'Use manifest to enables themes'.
755+Project -> Project Options -> Check 'Use manifest to enables themes'.
808756
809757### When I run Windows program created in Lazarus it starts with a DOS window
810758
811-Specify 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.
759+Specify 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.
812760
813761## macOS
814762
815763### Why does compiling a project fail with 'unknown section attribute: no_dead_strip'?
816764
817-Dead code stripping is not supported by the assembler and linker before Xcode 1.5 (available for macOS 10.3.9). Disable the compiler options:
765+Dead code stripping is not supported by the assembler and linker before Xcode 1.5 (available for macOS 10.3.9). Disable the compiler options:
818766
819-- Code \> Unit style \> Smart linkable (-CX)
820-- and Linking \> Link Style \> Link smart (-XX)
767+ * Code > Unit style > Smart linkable (-CX)
768+ * and Linking > Link Style > Link smart (-XX)
821769
822770### Xcode 3.1 and later
823771
824-The 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).
772+The 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).
825773
826-You will need to manually run the strip command line utility instead after compiling your executable.
774+You will need to manually run the strip command line utility instead after compiling your executable.
827775
828776### Debugging
829777
830778[[GDB Debugger Tips|Please see here for debugger issues under macOS]]
831779
832780## Licensing
833781
834782### Can I make commercial applications with Lazarus?
835783
836-Yes, 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.
784+Yes, 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.
837785
838786### Why are some components restricted from usage in commercial application?
839787
840-Lazarus 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".
788+Lazarus 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".
841789
842790### How do I know if a Component is part of the LCL?
843791
844-All 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.
792+All 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.
845793
846794### Can I make commercial plug-ins for Lazarus?
847795
848-Yes, 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.
796+Yes, 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.
849797
850798## Using the Forum
851799
852800### What is the correct way to ask questions in the forum?
853801
854-First 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.
802+First 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.
855803
856-When 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.
804+When asking a programming question, **always try to include some source code which demonstrates the problem**. Please surround your code with [code=pascal]...
805+``` 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.
857806
858-If 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.
807+If 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.
859808
860-Often an image is also very useful. You can host images in <https://imageshack.com/> and other similar websites and then post a link.
809+Often an image is also very useful. You can host images in <https://imageshack.com/> and other similar websites and then post a link.
861810
862-Try 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.
811+Try 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.**
863812
864-Finally, 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.
813+Finally, 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.
865814
866815For more tips about asking questions the smart way, read this: <http://catb.org/esr/faqs/smart-questions.html>
867816
868817See also: [[Forum|How to use the forum]]
869818
870819## Version numbering
871820
872-See the [[Version Numbering]] page for an explanation of the branching and version numbering of Lazarus.
821+See the [[Version Numbering]] page for an explanation of the branching and version numbering of Lazarus.
873822
874823## Problems/issues with old Lazarus/FPC versions
875824
876-Issues with old Lazarus/FPC versions and notes about upgrading are covered below.
825+Issues with old Lazarus/FPC versions and notes about upgrading are covered below.
877826
878-Often, the best solution is to upgrade; please see the various [Release Notes](/wiki-category/Release%20Notes)
827+Often, the best solution is to upgrade; please see the various [Release Notes](</Category:Release_Notes> "Category:Release Notes")
879828
880-### Why is the linking so slow on Windows (Lazarus \< 0.9.24)?
829+### Why is the linking so slow on Windows (Lazarus < 0.9.24)?
881830
882-> **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.
831+![Light bulb](https://upload.wikimedia.org/wikipedia/commons/d/d8/Nuvola_apps_ktip.png?utm_source=commons.wikimedia.org&utm_campaign=imageinfo&utm_content=original) **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.
883832
884-Generally 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).
833+Generally 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).
885834
886835Also, if you smartlink LCL the linking will be much slower. A study about this is located here: [[File size and smartlinking]]
887836
888-Starting from FPC 2.2, an internal linker is used which decreases the linking time dramatically.
837+Starting from FPC 2.2, an internal linker is used which decreases the linking time dramatically.
889838
890839### Old Lazarus does not support Windows-style resources; converting lrs resources
891840
892-Older 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}`.
841+Older 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}`.
893842
894843### Antivirus
895844
896-Excluding the Lazarus directory (and the directory/directories where your project/projects are) from on access virus scanning may help there.
845+Excluding the Lazarus directory (and the directory/directories where your project/projects are) from on access virus scanning may help there.
897846
898847## See also
899848
900-- [[Mac Installation FAQ]] for macOS.
901-- [[Unit not found - How to find units]] information on what to do when you get "unit not found" messages.
849+ * [[Mac Installation FAQ]] for macOS.
850+ * [[Unit not found - How to find units]] information on what to do when you get "unit not found" messages.
902851
903852---
904-*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).*
905-Category: FAQs
906-Category: Lazarus
907-Category: Troubleshooting
853+*From the Free Pascal wiki, page "Lazarus Faq", as the Internet Archive kept it on 2026-09-26, last changed on 2026-03-01. 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).*

Back to history