Sign in Join
Wiki copytemporary

Lazarus Faq/ja: what changed

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

OldNewLine
11## 一般的なこと
22
33### どうしてコンパイル後のバイナリがこんなに大きいの?
44
55バイナリが大きくなる理由は、GDB(GNU Debugger)で利用するデバッグ情報を含んでいるためです。
66
77実行ファイルからデバッグ情報を除去するオプション(-Xs)がありますが、 バージョン2.0.2以前のコンパイラではバグのため正しく動きません。バージョン2.0.4以降のコンパイラでは修正されています。
88
99"strip" というプログラムでデバッグ情報を除去することもできます。 これは、Lazarusディレクトリの下のlazarus\pp\bin\i386-win32\\ にあります。
1010
1111コマンドラインから、 "strip --strip-all \<実行ファイルへのパス\>" とタイプすることでデバッグ情報を除去できます。
1212
1313さらにプログラムを小さくしたい場合は、実行ファイルの圧縮ツール [UPX(upx.exe)](http://upx.sourceforge.net/) も利用できます。 これは、"strip" と同じく、Lazarusディレクトリの下の、lazarus\pp\bin\i386-win32\\ にあります。 圧縮を復元するためのメモリのオーバーヘッドはありませんし、復元速度も Pentium 133 で ~10MB/sec 程度と大変高速です。
1414
1515コマンドラインから、"upx \<実行ファイルへのパス\>" とタイプすることで、"upx" を利用できます。
1616
1717"strip" と "upx" を簡単な Lazarus の GUI プログラムに適用すると、Linux で 700kb 程度、 Windows で 420kb 程度のサイズに収まるでしょう。
1818
1919UPXの欠点などの詳細は、[[Size Matters|サイズについてにあります]]。
2020
2121また、重要なことですが、一般的な hello world すら lazarus で作成すると、以下のような大量の機能が含まれてしまいます。
2222
2323- XML 利用ライブラリ
2424- 画像利用ライブラリ(png, xpm, bmp, ico ファイルなど)
2525- Lazarus Component Library(LCL) のほとんどすべてのウイジェット
2626- すべての Free Pascal Runtime Library(RTL)
2727
2828このためにとても大きなサイズになりますが、実用アプリケーションで必要とされる機能をすでに含んでいるともいえます。
2929
3030Lazarus の実行ファイルのサイズは最初から大きいですが、ソースコードやフォームが増えても、少しづつしか増えません。 C++や他の言語では、hello world などはとても小さいかもしれませんが、実用的なアプリケーションを書くようになると急激にサイズが増加するでしょう。
3131
3232![](/wiki-images/d/de/Lazarus_vs_cpp.png)
3333
3434**Lazarus/FPC アプリケーションのサイズを縮小するための簡単なガイド** *(Lazarus 0.9.26 で確認)*
3535
3636- 1\. プロジェクト\|コンパイラオプション\|コード\|スマートリンク可能な(-CX) -\> チェックする。
3737- 2\. プロジェクト\|コンパイラオプション\|リンク\|デバッグ中\|実行ファイルからシンボルを除く(-Xs) -\> チェックする。
3838- 3\. プロジェクト\|コンパイラオプション\|リンク\|リンクスタイル\|スマートリンク(-XX) -\> チェックする。
3939
4040特に 2. が重要と思われます。 単純なアプリケーションは、いままでの 15-20 MB から 1-3 MB になります。 以下を試すのもよいでしょう: プロジェクト\|コンパイラオプション\|コード\|最適化\|速度より最小化を優先(-Os) -\> チェックする。 (実行速度が低下することに注意)
4141
4242- 4\. "UPX \<実行ファイルのパス\>" によって 1/2~1/3 に圧縮されます。 (注意: [[Size Matters|サイズについてにもあるように]]、UPX利用の欠点もあります。)
4343
4444**Chart of default sizes for an empty Application with various settings and operating systems**
4545
4646Well I ran tests I did on Lazarus 0.9.29 with FPC 2.4 (FPC 2.2.4 with Windows). *Optimized compiler* mean using the advices above but *without using UPX*. *Default Lazarus* means as installed from package/setup. *LCL without debug informations* mean after rebuilding Lazarus IDE and LCL without debug informations (-g-).
4747
4848   
4949
5050Default Lazarus
5151
5252   
5353
5454LCL without debug informations
5555
5656Ubuntu 64 bits / Lazarus 64 bits
5757
5858Default application
5959
6060   
6161
626213,4  Mb
6363
6464   
6565
66667,5 Mb / 8
6767
6868Optimized compiler
6969
7070   
7171
72724,4 Mb
7373
7474   
7575
76762,70 Mb (0.29svn FPC2.4 2,5)
7777
7878   
7979
8080Ubuntu 32 bits / Lazarus 32 bits
8181
8282Default application
8383
8484   
8585
868619,6  Mb
8787
8888   
8989
90905,7 Mb
9191
9292Optimized compiler
9393
9494   
9595
96962,9 Mb
9797
9898   
9999
1001001,6 Mb
101101
102102   
103103
104104Windows XP 32 bits / Lazarus 32 bits
105105
106106Default application
107107
108108   
109109
11011011,8 Mb
111111
112112   
113113
1141142,14 Mb
115115
116116Optimized compiler
117117
118118   
119119
1201201,62 Mb
121121
122122   
123123
1241241,50 Mb
125125
126126   
127127
128128Windows Seven 64 bits / Lazarus 64 bits
129129
130130Default application
131131
132132   
133133
13413412,3  Mb
135135
136136   
137137
1381383,20 Mb
139139
140140Optimized compiler
141141
142142   
143143
1441442,14 Mb
145145
146146   
147147
1481482,16 Mb
149149
150150### 'Fatal: Circular unit reference between a and b'(ユニットの循環的参照)エラーの回避
151151
152152新規ユーザーが、2つのフォーム(TForm)で相互にプロパティを参照し合いたい場合などに陥りやすいエラーです。このエラーは、「uses」を「interface」セクションで宣言しているためにおこり、「uses」を「implementation」に移すことで解消できます。
153153
154154エラーとなる例:
155155
156-` unit a;`\
157-` `\
158-` interface`\
159-` `\
160-` uses b;`\
161-` `\
162-` implementation`\
163-` `\
164-` end.`\
165-` ...`\
166-` unit b;`\
167-` `\
168-` interface`\
169-` `\
170-` uses a;`\
171-` `\
172-` implementation`\
173-` `\
174-` end.`
156+``` pascal
157+ unit a;
158+
159+ interface
160+
161+ uses b;
162+
163+ implementation
164+
165+ end.
166+ ...
167+ unit b;
168+
169+ interface
170+
171+ uses a;
172+
173+ implementation
174+
175+ end.
176+```
175177
176178エラーとならない例:
177179
178-` unit a;`\
179-` `\
180-` interface`\
181-` `\
182-` implementation`\
183-` `\
184-` uses b;`\
185-` `\
186-` end.`\
187-` ...`\
188-` unit b;`\
189-` `\
190-` interface`\
191-` `\
192-` implementation`\
193-` `\
194-` uses a;`\
195-` `\
196-` end.`
180+``` pascal
181+ unit a;
182+
183+ interface
184+
185+ implementation
186+
187+ uses b;
188+
189+ end.
190+ ...
191+ unit b;
192+
193+ interface
194+
195+ implementation
196+
197+ uses a;
198+
199+ end.
200+```
197201
198202### どうしてリンクがWindowsでは遅いのでしょうか?
199203
200204この問題は、 FPC2.2 以降かつ Lazarus 0.9.24 以降で解決されています。 Lazarus を更新してみてください。 古いバージョンについては以下を参照してください。
201205
202206一般的に、Windows でのリンクは他のプラットホームより時間がかかります。 これは、Free Pascal で利用している GNU リンカの動作が Windows で遅いためです。 この問題は Windows のみに影響し、比較的古くメモリの少ないコンピュータ (1GHz以下、128MB以下)で顕著に現れます。
203207
204208また、LCL をスマートリンクしている場合、リンク作業はさらに遅くなります。 この問題についての調査は[[File size and smartlinking/ja|ファイルサイズとスマートリンクにあります]]。
205209
206210内部リンカはすでに開発されていますが、 FreePascal 2.2 以上でないと利用できません。これは、リンク時間を劇的に短くします。
207211
208212**注意**: 2.1.1 では、Windows は win32/64/ce のために内部リンカを利用します。 これは作業を少し早めるでしょう。 Lazarus は 再コンパイルを行い、280MB ほどを使います。
209213
210214### ppc386.cfg や fpc.cfgは必要でしょうか?
211215
212216fpc.cfgのみ必要です。 コンパイラがライブラリを見つけるための方法が書いてあります。
213217
214218### どうしたらLazarusをコンパイルできますか?
215219
216220たとえば次のようにしてください。
217221
218-`$ cd lazarus`\
219-`$ make clean all`
222+```text
223+$ cd lazarus
224+$ make clean all
225+```
220226
221227### どのようにしたら、LCLをベースとした他のプロジェクトをビルドできますか?
222228
223229アプリケーション作成に IDE を使えない場合、lazbuild を利用してください。 これはコマンドライン版の Lazarus プロジェクトのビルド環境です。 IDE も lazbuild も使えない場合、fpc.cfg の最後に次の行を追加してください。
224230
225-`  # 他のツールキットの探索パス (Linux)`\
226-`  -Fu/usr/lib/fpc/$fpcversion/units/$fpctarget/{ツールキット}`
231+```text
232+ # 他のツールキットの探索パス (Linux)
233+ -Fu/usr/lib/fpc/$fpcversion/units/$fpctarget/{ツールキット}
234+```
227235
228-`  # 他のツールキットの探索パス (Windows)`\
229-` -Fu/{YourLazarusDirectory}/components/units/{ツールキット}`
236+```text
237+ # 他のツールキットの探索パス (Windows)
238+ -Fu/{YourLazarusDirectory}/components/units/{ツールキット}
239+```
230240
231241
232242{ツールキット} には、*gtk2*、*gnome*、*qt* や *win32* などを入れ、下記を実行してください。
233243
234244
235245ppc386 your.project.pp
236246
237247**ヒント:** ツールキットの開発パッケージのインストールを忘れないでください。 こんなメッセージを受け取るかもしれません。: [[Linker message: cannot find -l]].
238248
239249### どのバージョンの FPC(FreePascalCompiler) が必要ですか?
240250
241251FPC Version 2.2.2 が全オペレーティングシステムに対する推奨バージョンです。
242252
243253### Lazarusのコンパイルができません。
244254
2452551. コンパイラは正しいバージョンですか?
2462562. fpcのライブラリは同じバージョンですか?
2472573. コンパイラのインストールパスはスペースを含まないように!
2482584. fpc.cfg はありますか? 古い ppc386.cfg はあったらだめですよ。
2492595. OS 依存についての FAQ も確認してください。
250260
251261### プロジェクトをコンパイルしようとするとエラーがでます
252262
253263#### "Cannot find Unit interfaces". これはどうしたら解決できますか?
254264
255265これは、コンパイラが *interfaces.ppu* を見つけられなかったり、 見つけたが それがおかしなファイルであるときに表示されます。
256266
257267このユニットは、 {LazarusDir}\lcl\units\\{TargetCPU}-{TargetOS}\\{LCLWidgetSet}\interfaces.ppu にあります。 (例えば、/home/username/lazarus/lcl/units/i386-linux/gtk/interfaces.ppu)。
258268
259269他の場所などに色々なバージョンの *interfaces.ppu* がある場合、間違った構成になっている(例えば、検索パスに lcl のディレクトリを追加していたり)可能性が高いため、全ての *interfaces.ppu* を削除して、上記のディレクトリの *interfaces.ppu* だけにしてください。
260270
261271また、Lazarus をビルドするのに用いた widgetset と異なる widgetset を選択した場合、その widgetset 用に LCL をビルドする必要があります。
262272
263273上記の確認後にもこのエラーが発生する場合、 あなたが Lazarus IDE をコンパイルするのに用いたコンパイラやrtlと異なるコンパイラやrtlを用いてプロジェクトをコンパイルしていると考えられます。 以下を試してください。
264274
265275- LCL (もしくは、Lazarus丸ごと) を 環境 -\> オプション で選択しているコンパイラでリビルドしてください。 リビルドは、 ツール -\> Lazarusを構築 で行えます。 構築前に、 ツール -\> "Lazarus構築"を設定 で、現在の設定を確認してください。
266276
267277- 環境 -\> オプション で、コンパイラを Lazarus をコンパイルしたものに変更してください。 また、環境 -\> オプション で Lazarusディレクトリ や FPCソースディレクトリ へのパスが正しいかどうか確認してください。 さらに、コンパイラ構成ファイルである fpc.cfg が1つのバージョンのものだけがあるかどうか確認してください。 Linux/Unixシステムでは、/etc/ に、 Windows システムでは、fpcコンパイラと同じディレクトリにあるはずです。 "fpc -vt bogus" を実行し、どの fpc.cfg を利用しているかを確認してください。 コンパイラをアップデートした場合に、しばしば古いコピーがこっそり残ります。 ユーザーのホームディレクトリや新しいコンパイラをビルドしたディレクトリなどを確認して、これらを消去してください。
268278
269279- また、プロジェクトに利用しているウィジェットのセットを変更しても良いかもしれません。 例えば、Lazarus のサンプルフォルダにある "objectinspector" は、 gtk でコンパイルされています。 このプロジェクトを windows 上でコンパイルすると "Can't find unit interfaces" メッセージが表示されるでしょう。 ウィジェットセットを プロジェクト\|コンパイラオプション...\|LCLウィジェットタイプ(様々) から デフォルト(Win32) に変更することで問題が解決されます。
270280
271281### Delphi プロジェクトを lazarus でコンパイルしようとしたらエラーがでました
272282
273283#### {\$R *.DFM}という行について: これはどのように解決できますか?
274284
275285Lazarus (Linux という方が分かりやすい) はリソースを解釈できませんので、Delphi/Win32 でしていたような方法をとることはできません。しかしながら、Lazarus はこれと似たようなシンプルな代替方法が使用できます。次の手順を使えば、 Delphi レイアウト(.dfm ファイル)を使用できます:
276286
277287- オリジナルの .dfm ファイルが必要です。 Delphi5 以降はこれがデフォルトに成っています。もし古いバージョンを使っているのなら: ALT + F12 でテキストでレイアウトを参照して、コピー&ペーストすることができます。テキストの .dfm ファイルが得られたら、.lfm ファイルにコピーして下さい。
278288- (lazarus/tools の)lazres を使ってファイルを作成します。
279289
280-`     lazres yourform.lrs yourform.lfm`
290+```text
291+ lazres yourform.lrs yourform.lfm
292+```
281293
282294- イニシャライズセクションに次の行を付け加えます
283295
284-`     initialization`\
285-`     {$I yourform.lrs}`
296+```text
297+ initialization
298+ {$I yourform.lrs}
299+```
286300
287301lazarus では dfm ファイル内の全てのプロパティがサポートされているわけではないことを心にとどめておいて下さい。クラッシュする場合もあります。
288302
289303#### 'Identifier not found LazarusResources'というエラーが発生します。
290304
291305フォームを作成しているとき、Lazarusは自動的に他のユニットをフォームユニットのusesセクションに追加します。しかし、DelphiのユニットをLazarusのユニットに変換したときは、これは起こりません。 ですから、その場合LResourcesをフォームのユニットのUsesセクションに、追加する必要があります。
292306
293307### オブジェクトのイベントにアクセスする時、たとえば、ボタンのolclickイベントなどで、次のようなエラーが出ます。 ERROR unit not found: stdCtrls
294308
295309Project -\> Project Inspectorで、プロジェクトが'LCL'パッケージに依存していることを確かめてください。そして、FPCソースをインストールしていることを確かめてください。
296310
297311LazarusはIDEであり、LCLというビジュアルコンポーネントライブラリです。その他のIO,Database,FCL,RTLといったものは、FPCから提供されます。IDEは全てのソースへのパスを必要とします。
298312
299313FPCのソースパスは、次のように設定できます。 Environment -\> General Options -\> Files -\> FPC source path
300314
301315### 別のファイルなしで、実行ファイルだけにできますか?どうしたらリソースを埋め込むことができますか?
302316
303317例えば、次のようにしてください:
304318
305-`/your/lazarus/path/tools/lazres sound.lrs sound1.wav sound2.wav ...`
319+```text
320+/your/lazarus/path/tools/lazres sound.lrs sound1.wav sound2.wav ...
321+```
306322
307323これは、sound1.wavとsound2.wabから、sound.lrs(訳注:というLazarusのリソースファイル)を生成します。
308324
309325そして、これをlrsフォームにこっそりインクルードします。
310326
311-`...`\
312-`initialization`\
313-`{$i unit1.lrs} // 必ず最初にメインのリソースファイルを指定します。`\
314-`{$i sound.lrs} // ユーザー定義のリソースファイル`\
327+``` pascal
328+...
329+initialization
330+{$i unit1.lrs} // 必ず最初にメインのリソースファイルを指定します。
331+{$i sound.lrs} // ユーザー定義のリソースファイル
315332
316-`end.`
333+end.
334+```
317335
318336プログラムで、これらのファイルを使うことが出来ます。
319337
320-`Sound1AsString:=LazarusResources.Find('sound1').Value;`
338+``` pascal
339+Sound1AsString:=LazarusResources.Find('sound1').Value;
340+```
321341
322342(訳注:とりあえずバイナリファイルをStringとして取り出すことができる あとは、これをファイルに書き出して読み込むか、ストリームとして流し込むか、など)
323343
324344### Lazarusで使っている色んなファイル拡張子にはどんな意味がありますか?
325345
326346[[Lazarus Tutorial/ja|Lazarus Tutorial/ja#The Lazarus filesで]]例としていくつかの拡張子について説明しています。 ここでは簡潔に示します。
327347
328348`*.lpi`
329349Lazarus Project Information ファイル (XML形式; プロジェクト固有の設定情報を持っています)
330350
331351`*.lpr`
332352Lazarus Program file; メインのプログラムとなるパスカルのソースです。
333353
334354`*.lfm`
335355Lazarus Form file; フォーム上の全てのオブジェクトの情報を持っています。 (Lazarus固有のフォーマットです。アクションは対応する`*.pas` ファイル内に記述されます)
336356
337357`*.pas` or `*.pp`
338358Unit with Pascal code; Pascal で書かれたユニット (一般的にフォームは対応する`*.lfm`ファイルにあります。)
339359
340360`*.lrs`
341361Lazarus Resource file; リソースファイル (これは生成されたファイルです。Windowsのリソースファイルと混同しないでください。). (訳注: フォームの要素などを定義したファイルです。)
342362
343363このファイルは、lazres tool (ディレクトリLazarus/Toolsにある)で、コマンドラインを使って生成されます。
344364
345-` lazres myfile.lrs myfile.lfm`
365+```text
366+ lazres myfile.lrs myfile.lfm
367+```
346368
347369`*.ppu`
348370Compiled unit; コンパイルされたユニット
349371
350372`*.lpk`
351373Lazarus package information file. (XML形式; パッケージ固有の設定情報を持っています)
352374
353375### テキストファイル型変数を *var mytext: text;* と宣言すると "Error: Error in type definition" と言われる。どうすればいいの?
354376
355377TControl クラスが [[doc:lcl/controls/tcontrol.text.html|Text]] プロパティを持っているからです。フォームのメソッドの中では、system ユニット(訳注: 暗黙のうちに uses される、Free Pascalのランタイムライブラリ)にある [[doc:rtl/system/text.html|Textよりもこちらが]]先に見えてしまいます。テキストファイル型に対するいいかえである[[doc:rtl/system/textfile.html|TextFile]] 型を使うか、ユニット名を明示して型宣言を行います。
356378
357-`var`\
358-`  MyTextFile: TextFile;`\
359-`  MyText: System.Text;`
379+``` pascal
380+var
381+ MyTextFile: TextFile;
382+ MyText: System.Text;
383+```
360384
361385同様の問題がファイル名の登録とテキストファイルのクローズの際に起こります。TForm が *assign* メソッドと [[doc:lcl/forms/tcustomform.close.html|Close]] メソッドを持っているからです。 [[doc:rtl/objpas/assignfile.html|AssignFile]] 及び [[doc:rtl/objpas/closefile.html|CloseFile]] を用いるか、手続き名に system を付けて下さい(訳注: system.assign, system.close とする)
362386
363387### Printer.BeginDoc がエラーを起こす
364388
365389Printers ユニットを uses 節に含める必要があります。
366390
367391Printer4Lazarus パッケージをプロジェクトが必要とするものの中に含める必要があります。これはIDEから次のようにします: Project\|Project Inspector\|Add\|New Requirement\|Package Name:
368392
369393ドロップダウンボックスの中に Printer4Lazarus パッケージがなければ、インストールしなければなりません。このパッケージは、Lazarusをインストールした時に次のディレクトリに置かれています: \[lazarus installed directory\]\components\printers
370394
371395\[lazarus installed directory\] はデフォルトでは以下のの通りです:
372396
373397- Windows: c:\lazarus
374398- Linux: /usr/lib/lazarus
375399
376-`Printer.Printers を参照すると例外が発生する場合も同様にしてください。`
400+```text
401+Printer.Printers を参照すると例外が発生する場合も同様にしてください。
402+```
377403
378404### TForm.ClientWidth/ClientHeightがTForm.Width/Heightと同じ値になるのはなぜ?
379405
380406LCLではTForm.Width/Heightはフレームを含まないので、同じになります。なぜなら、すべてのプラットホームでフレームのサイズを取得する方法がないからです。 (特定のOS上などに限定するなどして)信頼できる方法でなくてもよければ、LCLは(フレームを含まない指定値によって)フォームをスクリーン上で移動やリサイズすることができます。
381407
382408一方、すべてのプラットホームで、フレーム込みのウインドウサイズについては取得することができ、変更することもできます。
383409
384410過去のLCLフォームとの互換性を保つために特殊なバージョンの定数といくつかの拡張メソッドが追加されるでしょう。
385411
386412## Debugger
387413
388414### どうしたらデバッグ出力を見る事ができますか?
389415
390416LCLにはデバッグ出力に書くためのLCLProc手続きがあります。
391417
392418- **DebugLn:** は引数に1つの文字列しか受け取れませんが、WriteLnと同じように動作します。* **DbgOut:** は引数に1つの文字列しか受け取れませんが、Writeと同じように動作します。
393419
394420(*訳注:PascalではWrite,WriteLnは可変引数を取る稀有な関数である。)
395421
396422普通の環境では、出力はstdoutに対して行われます。しかし、stdoutが閉じている場合(たとえば、{\$AppType Gui}のアプリケーションであったり、Windowsで -WGオプションが指定されてコンパイルされている場合など)、出力されません。
397423
398424デバッグ出力は、そのような時でもファイルに出力されます。LCLProcユニットはinitialization部で、'--debug-log=\<file\>'というコマンドラインパラメータをチェックします。もし、これがあれば、デバッグ出力を\<file\>にします。
399425
400426この--debug-logコマンドラインパラメータがない場合、環境変数 xxx_debuglogが存在するかどうか確認します。xxxは、拡張子のないプログラムファイル名です。lazarusの場合は、lazarus_debuglogです。もし、このような環境変数がある場合、デバッグ出力のためのファイルを使います。たとえば、
401427
402-` set lazarus_debuglog=c:\lazarus\debug.txt`
428+```text
429+ set lazarus_debuglog=c:\lazarus\debug.txt
430+```
403431
404432としたとしましょう。 デバッグ出力は、c:\lazarus\debug.txtに行われます。
405433
406434この実装は、lclproc内で行われ、全てのアプリケーションはlclprocを使うため、この出力手法を使うことができます。 Lazarusをデバッグする場合 : Windowsでもっとも効果的な方法です。もし、出力をコンソールに出したい場合、lazarus.ppに{\$APPTYPE console}を加えてください。そして、Lazarusをリビルドしてください。
407435
408436### How Can I inspect properties?
409437
410438You have to use the latest FPC from trunk (2.5.1) or 2.4 once it is released.
411439
412440If you compile your application using -gw (dwarf debug info), you should be able to inspect properties.
413441
414442Note this is only true for properties that map directly to a variable (the "read" declaration points to a member, not a function).
415443
416444If 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.
417445
418446The optional ability to explicitly inspect the results of functions (with the risks described) , and therefore calling code from the debugger is not yet implemented
419447
420448### Why does the debugger not show some Variables/Structures ("no such symbol"/"incomplete type")
421449
422450For problems debugging: - properties\
423451\- Array of ... (Dynamic Array)\
424452\- Variables in Nested Procedures\
425453\- "no such symbol in context"\
426454\- "incomplete type"\
427455Please see [[GDB Debugger Tips]]
428456
429457### How can I debug FCL components from packages with Lazarus
430458
431459FCL 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.
432460
433461This 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.
434462
435463Before 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:
436464
437-`-Fu/usr/local/lib/fpc/$fpcversion/units/$fpctarget/*`
465+```text
466+-Fu/usr/local/lib/fpc/$fpcversion/units/$fpctarget/*
467+```
438468
439469Make 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.
440470
441471**Step 1**: Open a shell terminal\
442472**Step 2**: cd /user/local/share/src/fpc-2.3.1/fpc/fcl-db/\
443473**Step 3**: sudo make clean all install INSTALL_PREFIX=/usr/local OPT=-gl\
444474Note: INSTALL_PREFIX parameter should be properly configured for units to be installed. In the sample below /usr/local is a default fpc path for Linux, but may vary on other OSes.
445475
446-`make clean all install INSTALL_PREFIX=/usr/local OPT=-gl`
476+```text
477+make clean all install INSTALL_PREFIX=/usr/local OPT=-gl
478+```
447479
448480Finally, after rebuilding any FCL units you may want to rebuild LCL as well.
449481
450482### Problems with GDB on Mac OSX
451483
452484[[GDB Debugger Tips|Please see here for debugger issues under Mac]]
453485
454486## Contributing / Making Changes to Lazarus
455487
456488### IDE の、メッセージウィンドとソースエディタウィンドをドッキングできる素敵なパッチを作成したのですが、採用してくれませんか?
457489
458490完全なドックマネージャ(ドッキングマネージャ)を作るという目標があるので、ドッキングについてのちょっとしたパッチは、採用されません。 完全なドックマネージャとは、
459491
460492- すべてのIDEウインドウをドッキングできる。
461493- ユーザー定義ウインドウをドッキングできる。
462494- ドッキングレイアウトを保存して、次にロードされたときは再生できる。
463495- ページとしてもドッキングできる。
464496- ドラッグドロップを必ずしも必要としない。
465497
466498これらは大変難しいものと思われますが、そうでなければパッチは拒否されます。
467499
468500Such 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 ... or not at all. For instance:
469501
470502 +-------------------++--+
471503 |menu || |
472504 +-------------------+| |
473505 +--++---------------+| |
474506 |PI|| Source Editor ||CE|
475507 +--+| || |
476508 +--+| || |
477509 | |+---------------++--+
478510 |OI|+-------------------+
479511 | ||messages |
480512 +--++-------------------+
481513
482514The 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.
483515
484516As a temporary solution you can use this IDE extension: [[Manual Docker]]
485517
486518### lazarusを修正したり、改良しました。どのようにしたら公式Lazarusソースに、自分の変更を加えることができますか?
487519
488520パッチを作成して、開発者グループに送ってください。詳細は、[[Creating A Patch/ja|Creating A Patch/jaを]]見てください。
489521
490522### どうしたら、lazarusの開発者、SVNのアクセス管理者、バグトラッカーになれますか?
491523
492524まず最初に、Lazarusのことを学び、あなたのスキルと知識を証明してください。 [[Lazarus Documentation|wiki articlesを]]読むことからはじめて、ソースコードを読み、 [Lazarus Bug-Tracker](http://www.lazarus.freepascal.org/mantis)を見て、いくつかのバグをfixした上で、もし、あなたが充分そうなる資格があると思ったら、[メーリングリストの開発者コミュニティ](http://www.mail-archive.com/lazarus@miraclec.com)にコンタクトしてみてください。
493525
494526## 定義はどこにありますか?
495527
496528### 仮想キーコード定数
497529
498530仮想キーコード定数は、LCLTypeに定義されています。仮想キーコード定数を使うユニットのuses内にLCLTypeを加えてください。 Virtual key constants are defined in LCLType. Add LCLtype to your uses.
499531
500532## IDEを使う
501533
502534### どうしたら"identifier 補完"を使えますか?
503535
504536\[ctrl\]\[space\]で、identifier補完機能を呼び出すことができます。
505537
506538メニューの*Environment -\> Editor Options -\> Code Tools -\> Automatic Features* で、identifier補完が自動的に高速におこなわれるようにセットすることができます。
507539
508540## Linux
509541
510542### Linux上でIDEから離れてデバッグを行いたいのですが
511543
512544まず、デバッガが必要です。GDBはLinuxの標準的デバッガでいくつかのGUIフロントエンドが使用できます。dddはそのなかでも一般的なもので、多くのディストリビューションに採用されています。lazarus/lclをデバッグ情報付きでコンパイルするには次のようにして、更にデバッグを開始して下さい。
513545
514-` $ make clean; make OPT=-dDEBUG`\
515-` $ ddd lazarus`
546+```text
547+ $ make clean; make OPT=-dDEBUG
548+ $ ddd lazarus
549+```
516550
517551お断りしておきますがdddはlazarusのデバッガより扱いづらいと思います。例を挙げますと、ddd/gdbは大文字小文字の違いにうるさい言語を対象として作られていますが、Pascalはそうではありません。従ってあなたはそれらのコンテンツを見るためには、すべてを大文字でタイプしなければなりません。詳しくはfpcのマニュアルを参照して下さい。
518552
519553### デバッグ中なのですが、dddはソースコードが見つからないとか、含まれていないとか言います。どうしたらいいんでしょう
520554
521555それはgdbやdddに対してパスが指定されていないことに起因する問題によるものです。解決できる問題です。
522556
523557- dddのメニューから "Change directory"コマンドを使ってソースコードが存在するディレクトリを指定してください。しかしこの方法ではプログラムを開始したディレクトリを使用することができません。あなたは複数回ディレクトリを指定し直す必要があるかもしれません。
524558
525559- dddのEditメニューからgdb-settingsをたどって、検索パスを追加して下さい。
526560- \$(HOME)/.gdbinitに次のようなテキストファイルを作って下さい。あるいは追加してやって下さい:
527561
528-`     directory /your/path/to/lazarus`\
529-`     directory /your/path/to/lazarus/lcl`\
530-`     directory /your/path/to/lazarus/lcl/include`
562+```text
563+ directory /your/path/to/lazarus
564+ directory /your/path/to/lazarus/lcl
565+ directory /your/path/to/lazarus/lcl/include
566+```
531567
532568
533569
534570(訳注:ホームディレクトリ直下に.gdbinitというファイルを作ってくれ、という意味です。これは不可視属性になりますのでls -Aしないと見られなくなります--User:Tooka)
535571
536572### リンク中に/usr/bin/ld can't find -l\<hogehoge\>というエラーが出ます
537573
538574**パッケージベースのディストリビューションの場合(大抵はこれ)**
539575hogehoge.soとかhogehoge.aという名前のファイルを含むパッケージをインストールして下さい。Linuxにおいてダイナミックリンクライブラリは.so、スタティックリンクライブラリは.aの拡張子を持つことになります。Linuxディストリビューションによってはすでにパッケージの名前がhogehogeのものがインストールされているかもしれません。しかし、そのときは開発用パッケージが必要なのかもしれません。hogehoge-devのインストールをしてみましょう。そのなかにhogehoge.aやhogehoge.soがある、ということはよくあることです。
540576
541577**ソースコードベースのディストリビューションや自分で設定したシステムの場合(LFS)**
542578hogehoge.aをmakeしてパスの通ったディレクトリにおいて下さい。必要ならば、hogehoge-version.so(.a)へのシンボリックリンクをhogehoge.so(.a)に作成しておきましょう.
543579
544580**FreeBSD**
545581これはソースコードベースのディストリビューションと同じく、makeしてやって-Fl/use/local/libをfpc.cfgに追加するか、追加して更にLazarusライブラリパスに配置します。 GTK1.2には「FreeBSDのパッケージ名としてのgtk12」があるのを覚えておいてください。 (glibと同じように)
546582
547583**NetBSD**
548584これはソースコードベースのディストリビューションと同じく、makeしてやって-Fl/use/local/libをfpc.cfgに追加するか、追加して更にLazarusライブラリパスに配置します。
549585
550586### どうやってKylix2のプロジェクトをLazarusに変換して取り込めばいいでしょう
551587
552588Kylixのプロジェクトの変換はDelphi/VCLプロジェクトの変換に似ています。
553589
554590LCL(Lazarus Component Library)はDelphiのVCLと互換性を持つように作られています。 KylixのCLXはQTと互換性を持つように作られています。 一般的なヒントを以下に記します:
555591
556592- すべてのCLXが使うQ-ユニット——QForms,QControls,QGraphicsとか——をVCL風に変更してください。Forms,Control,Graphicsのように。
557593- Formを使うソースコードのusesセクションにLResourcesを追加してください。
558594- すべての.xfmファイルをコピーするかリネームして拡張子を.lfmにしてください。
559595- すべての.dprファイルをコピーするかリネームして拡張子を.lprにしてください、
560596- .lprファイルのinterfaceセクションに、Interfacesを追加してください。
561597- {\$R *.res}という記述を削除してください。
562598- {\$R *.xfm}という記述を削除してください。
563599- .pasファイルと.lprファイルに{\$mode objfpc}{\$H+}か{\$mode delphi}{\$H+}という記述を追加してください。
564600- Add an initialization section to the end of each form source and add an include directive for the .lrs file (lazarus resource file):
565601
566-` initialization`\
567-`   {$I unit1.lrs}`
602+```text
603+ initialization
604+ {$I unit1.lrs}
605+```
568606
569607
570608The .lrs files can be created via the lazres tool in: (lazarusdir)/tools/lazres.
571609
572610For example: ./lazres unit1.lrs unit1.lfm
573611
574612- Fix the differences. The LCL does not yet support every property of the VCL and the CLX is not fully VCL compatible.
575613
576614### lazarusをコンパイルしているとき、コンパイラがユニットを見つけられません。e.g.: gtkint.pp(17,16) Fatal: Can't find unit GLIB
577615
5786161\. 完全にクリーンな状態してください: 'make clean all' を実行します
579617
5806182\. コンパイラのバージョンを確認してください(2.0.0 以上)
581619
5826203\. コンパイラが正しい設定ファイルを使用しているか確認してください。通常は /etc/fpc.cfg にインストールされます。しかし、fpc は ~/.ppc386.cfg や、~/.fpc.cfg、/etc/ppc386.cfg といったファイルを調べ、最初に見つけたものだけを使用します。 (~ はホームディレクトリを指します)
583621
584622
585623**ヒント:** 'ppc386 -vt bogus'とすることでコンフィグファイルを探すことが出来ます。
586624
587625複数の ppc386.cfg を使用するのは古い方法ですので削除して下さい。
588626
5896274\. コンフィグファイル(/etc/fpc.cfg)の中で fpc のライブラリのパスが正しく設定されているか確認して下さい。fpc のライブラリパスの設定は次のように行います。
590628
591-`   -Fu/usr/lib/fpc/$fpcversion/units/$fpctarget`\
592-`   -Fu/usr/lib/fpc/$fpcversion/units/$fpctarget/rtl`\
593-`   -Fu/usr/lib/fpc/$fpcversion/units/$fpctarget/*`
629+```text
630+ -Fu/usr/lib/fpc/$fpcversion/units/$fpctarget
631+ -Fu/usr/lib/fpc/$fpcversion/units/$fpctarget/rtl
632+ -Fu/usr/lib/fpc/$fpcversion/units/$fpctarget/*
633+```
594634
595635
596636最初の部分のパス(/usr/lib/fpc)は、あなたの環境に適合させて下さい。システムによっては、/usr/local/lib/fpc/...とった指定の仕方をする場合もあります。
597637
598638**ヒント:** コマンドラインから'ppc386 -vt bogus'とすることでサーチパスを確認することが出来ます。
599639
6006405\. コンフィグファイル(/etc/fpc.cfg)の中で LCL のソースファイル(.pp、.pas)が正しく設定されているか確認して下さい:
601641
602-` forbidden: -Fu(lazarus_source_directory)/lcl`\
603-` forbidden: -Fu(lazarus_source_directory)/lcl/interfaces/gtk`
642+```text
643+ forbidden: -Fu(lazarus_source_directory)/lcl
644+ forbidden: -Fu(lazarus_source_directory)/lcl/interfaces/gtk
645+```
604646
605647
606648もしあなたの fpc プロジェクトに LCL を付け加えたいなら、上述のfpc のライブラリのパスの後に、次の二つのパスを設置します。:
607649
608-` -Fu(lazarus_source_directory)/lcl/units/$fpctarget`\
609-` -Fu(lazarus_source_directory)/lcl/units/$fpctarget/gtk`
650+```text
651+ -Fu(lazarus_source_directory)/lcl/units/$fpctarget
652+ -Fu(lazarus_source_directory)/lcl/units/$fpctarget/gtk
653+```
610654
6116556\. 見つからないユニット(glib.ppu)が fpc ライブラリのディレクトリに存在しているか確認して下さい。例えば、gtk.ppu は /usr/lib/fpc/\$version/units/i386-linux/gtk/ の中に見つけることができます。もしこれらが存在していないならば、fpc ライブラリは正常ではないので、再インストールして下さい。
612656
6136577\. ソースファイルが NFS でマウントされたディレクトリに置かれていないか確認して下さい。あるケースでは、NFS が作成したファイルを不正に更新していました。ソースを NFS ではないディレクトリに移動させて、コンパイルをして下さい。
614658
615659### I have installed the binary version, but when compiling a simple project, lazarus gives: Fatal: Can't find unit CONTROLS
616660
617661Probably 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:
618662
619-` $ bash`\
620-` $ svn checkout `[`http://svn.freepascal.org/svn/lazarus/trunk`](http://svn.freepascal.org/svn/lazarus/trunk)` lazarus`\
621-` $ cd lazarus`\
622-` $ make clean all`
663+```text
664+ $ bash
665+ $ svn checkout http://svn.freepascal.org/svn/lazarus/trunk lazarus
666+ $ cd lazarus
667+ $ make clean all
668+```
623669
624670Make sure that lazarus get the new source directory: Environment-\>General Options-\>Files-\>Lazarus Directory Top
625671
626672### Lazarusのコンパイルをして、リンク中にこんなことを言われます: libgdk-pixbuf not found
627673
628674gdk-pixbufライブラリ(gkt1.x)をインストールするか使用しないようにします。
629675
630676gdk-pixbufライブラリはこちらにあります:
631677
632678RPMs: <http://rpmfind.net/linux/rpm2html/search.php?query=gdk-pixbuf&submit=Search+>...&system=&arch=
633679
634680Debianパッケージ: libgdk-pixbuf-dev
635681
636682ソースコード: <ftp://ftp.gnome.org/pub/gnome/unstable/sources/gdk-pixbuf/>
637683
638684Lazarusでしないように設定するには:"ツール"→"Lazarusのビルド設定"にオプションを追加します。 '-dNoGdkPixBufLib' もしくはコマンドラインで次のようにしてください。 "make clean all OPT=-dNoGdkPixBufLib".
639685
640686### SuSEを使っていますが、リンク時に/usr/bin/ld が Cannot find -lgtk Error というエラーを返します
641687
642688SuSE は gtk の開発用ライブラリを /opt/gnome/lib (64bits 版の場合は /opt/gnome/lib64)にインストールします。このパスは標準的なものではありません。シンプルな解決方法は、/etc/fpc.cfg にこのパスを追加することです。 (-Fl/opt/gnome/lib).
643689
644690### Lazarus crashes with runtime error 211 after I installed a component
645691
646692After I installed a component, Lazarus crashes with the following message:
647693
648-`Threading has been used before cthreads was initialized.`\
649-`Make cthreads one of the first units in your uses clause.`\
650-`Runtime error 211 at $0066E188`
694+``` pascal
695+Threading has been used before cthreads was initialized.
696+Make cthreads one of the first units in your uses clause.
697+Runtime error 211 at $0066E188
698+```
651699
652700How can I fix this?
653701
654702Your 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:
655703
6567041\) Change the source of ide/lazarus.pp: add the cthreads as first unit to the uses clause, so that is looks like this:
657705
658-`uses`\
659-`  //cmem,`\
660-`  cthreads, `\
661-`  {$IFDEF IDE_MEM_CHECK}`\
662-`...`
706+``` pascal
707+uses
708+ //cmem,
709+ cthreads,
710+ {$IFDEF IDE_MEM_CHECK}
711+...
712+```
663713
664714and rebuild lazarus.
665715
6667162\) In order to avoid modifying lazarus.pp file, a fpc compiler option could be used. Once package that uses threads has been compiled, 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.
667717
668718*Hint:* Maybe your old (non-crashing) lazarus executable is stored as lazarus.old in the same directory as the crashing lazarus executable.
669719
670720### スレッドを含むプログラムを実行するとランタイムエラー232で終了する
671721
672722正確なエラーメッセージは:
673723
674-`This binary has no thread support compiled in.`\
675-`Recompile the application with a thread-driver in the program uses`\
676-`clause before other units using thread.`\
677-`Runtime error 232`
724+``` pascal
725+This binary has no thread support compiled in.
726+Recompile the application with a thread-driver in the program uses
727+clause before other units using thread.
728+Runtime error 232
729+```
678730
679731**解決方法**: メインプログラム(通常は .lpr ファイルです)の uses 節の先頭に cthreads を追加して下さい。
680732
681733### Ubuntu 6.06でIDEのフォントが文字化けするのですが
682734
683735LazarusがGtk1.2でコンパイルされた場合、Gtk2のためのGnome設定/フォントは無効です。 この場合、次のように対処してみてください: (もしまだなければ).gtkrc.mineというファイルをホームディレクトリに作成します。その中に以下の行を納入してください。
684736
685737 style "default-text" {
686738 fontset = "-ipa-uigothic-medium-r-normal-*-*-120-*-*-*-*-jisx0212.1990-0,
687739 -*-arial-medium-r-normal--*-100-*-*-*-*-iso8859-1,\
688740 -*-helvetica-medium-r-normal--*-100-*-*-*-*-*-*"
689741 }
690742
691743 class "GtkWidget" style "default-text"
692744
693745ここで120というのはフォントサイズ(12になる)です。適当に調整してください。
694746
695747### Ubuntuを使っています。ライブラリが見つからないために Gtk2 プログラムがコンパイルできません
696748
697749Ubuntu には、インストールしたライブラリをリンク可能にするためのシンボリックリンクが、全てのライブラリで作成されるわけではないという問題があります。Gtk2 をリンクしようとした際に見つからないと指摘されたライブラリに、適切なシンボリックリンクがあるかどうか確認してください。例えば次のような方法があります:
698750
699751 cd /usr/lib
700752 sudo ln -s libgdk-x11-2.0.so.0 libgtk-x11-2.0.so
701753
702754実際のライブラリ(上の例では libgdk-x11-2.0.so.0)に対し、\[ライブラリ名\].so (上の例では libgdk-x11-2.0.so)というリンク可能なシンボリックリンクが作られます。
703755
704756### どうすればGtk2プログラムをコンパイルすることが出来ますか?
705757
706758今のところ、Gtk2 版 IDE は少し不安定(little unstable)です。ですが、Gtk1 版 IDE を使って Gtk2 のソフトウェアをコンパイルすることは可能です。
707759
708760Gtk2 用の LCL でリコンパイルするには、メニューの“Tools”-\>“Configure Build Lazarus”から、LCL を clean+build に、everything else を none にセットします。
709761
710762Ok ボタンをクリックし、“Tools”-\>“Build Lazarus”を選択します。
711763
712764続いてコンパイラオプションに進み、Gtk2 用のウィジェットセットに変更することで、Gtk2 のソフトウェアをコンパイルできるようになります。
713765
714766## Windows
715767
716768### コンパイラを使っているときに、"The name specified is not recognized as an internal or external command, operable program or batch file.\>& was unexpected at this time." というメッセージが出ることがあります。
717769
718770コンパイラディレクトリに make.cmdというOS2用のscriptfileが存在しています。Windows-NTでは、それは必要ないのですが、NTがスクリプトファイルとみなしますので、取り除いてください。
719771
720772### コンパイルしているときに、"make\[3\]: ./ppc1.exe: Command not found"というメッセージが出ます。
721773
722774どういう訳か、makeコマンドがパスを消失しています。basedirを次のようにセットしてください。
723775
724776
725777make cycle BASEDIR=your_fpc_source_dir_herecompiler
726778
727779### Lazarusをコンパイルしているときに受け取るメッセージ
728780
729781#### make.exe: * * * interfaces: No such file or directory (ENOENT). Stop.make.exe: * * * \[interfaces_all\] Error 2
730782
731783makeファイルを更新する必要があります。
732784
733785#### makefile:27: *** You need the GNU utils package to use this Makefile. Stop.
734786
735787スペースがはいっているパスにFPCをインストールしていないかどうか、確認してください。スペースがはいっているパスを、Makefileはサポートしません。
736788
737789### どうしたらlazarusのように、自分が作ったプログラムをXP風の見栄えにできますか?
738790
739791myprogram.exeというプログラムの場合は、myprogram.exe.manifestというファイルを作成し、次をコピーペーストしてください。
740792
741-`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>`\
742-`<assembly xmlns="`[`urn:schemas-microsoft-com:asm.v1`](urn:schemas-microsoft-com:asm.v1)`" manifestVersion="1.0">`\
743-`<assemblyIdentity processorArchitecture="*" version="1.0.0.0" type="win32" name="myprogram"/>`\
744-`<description>programom</description>`\
745-`<dependency>`\
746-`  <dependentAssembly>`\
747-`   <assemblyIdentity`\
748-`     type="win32"`\
749-`     name="Microsoft.Windows.Common-Controls"`\
750-`     version="6.0.0.0"`\
751-`     publicKeyToken="6595b64144ccf1df"`\
752-`     language="*"`\
753-`     processorArchitecture="*" />`\
754-`  </dependentAssembly>`\
755-`  </dependency>`\
756-`</assembly>`
793+``` pascal
794+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
795+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
796+<assemblyIdentity processorArchitecture="*" version="1.0.0.0" type="win32" name="myprogram"/>
797+<description>programom</description>
798+<dependency>
799+ <dependentAssembly>
800+ <assemblyIdentity
801+ type="win32"
802+ name="Microsoft.Windows.Common-Controls"
803+ version="6.0.0.0"
804+ publicKeyToken="6595b64144ccf1df"
805+ language="*"
806+ processorArchitecture="*" />
807+ </dependentAssembly>
808+ </dependency>
809+</assembly>
810+```
757811
758812ほらね、XP風でしょ?
759813
760814### WindowsでLazarusで作ったプログラムを実行させるとDOS窓で開始してしまいます
761815
762816コマンドラインのコンパイラを使っている場合は-WGオプション(=Windows GUI)を指定してください。 LazarusIDEの場合は、Project menu -\> Compiler Options -\> Linking -\> target OS Specific optionsで、コンパイラオプションダイアログでWindows GUIをチェックしてください。
763817
764818## Mac OS X
765819
766820### Why does compiling a project fail with 'unknown section attribute: no_dead_strip'?
767821
768822Dead code stripping is not supported by the assembler and linker before Xcode 1.5 (available for Mac OS X 10.3.9). Disable the compiler options
769823
770824- Code \> Unit style \> Smart linkable (-CX)
771825- and Linking \> Link Style \> Link smart (-XX)
772826
773827## Licensing
774828
775829### Can I make commercial applications with Lazarus ?
776830
777831Yes, the LCL is licensed under the 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.
778832
779833### Why are some components restricted from usage in commercial application ?
780834
781835Lazarus 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".
782836
783837### How do I know if a Component is part of the LCL ?
784838
785839All LCL units are in the directory "lcl". A List of units belonging to the LCL can be found here <http://lazarus-ccr.sourceforge.net/docs/lcl/> . If you code uses units not listed on this page, you may have used a component that is not part of the LCL.
786840
787841### Can I make commercial plug-ins for Lazarus ?
788842
789843Yes, 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.
790844
791845## Contributors and Comments
792846
793847This page has been converted from the epikwiki [version](http://lazarus-ccr.sourceforge.net/index.php?wiki=LazarusFaq).
794848
795849---
796850*From the Free Pascal wiki, page "Lazarus Faq/ja", as it stood on 2015-06-06 after a change by FTurtle, 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).*
797851Category: FAQs/ja
798852Category: Japanese
799853Category: Lazarus/ja

Back to history