Difference between revisions of "Installing Lazarus/ja"

From Lazarus wiki
Jump to navigationJump to search
Line 80: Line 80:
 
As an alternative to the daily zip files of the SVN sources, the SVN repository has been made accessible for everyone, with read-only access. This means that you can directly access the code, and you will have really the last-minute sources available. It is also a method which requires less bandwidth once you have done the first download (checkout in SVN lingo).
 
As an alternative to the daily zip files of the SVN sources, the SVN repository has been made accessible for everyone, with read-only access. This means that you can directly access the code, and you will have really the last-minute sources available. It is also a method which requires less bandwidth once you have done the first download (checkout in SVN lingo).
 
===== Development snapshots =====
 
===== Development snapshots =====
どのようにするか?
+
下に手順を述べます。
 
(当然、SVNをインストールしておく必要があります。一連のやり方については [http://subversion.tigris.org/ here] を見てください)
 
(当然、SVNをインストールしておく必要があります。一連のやり方については [http://subversion.tigris.org/ here] を見てください)
  

Revision as of 11:30, 25 August 2006

Deutsch (de) English (en) español (es) suomi (fi) français (fr) magyar (hu) 日本語 (ja) 한국어 (ko) polski (pl) português (pt) русский (ru) slovenčina (sk) Tiếng Việt (vi) 中文(中国大陆)‎ (zh_CN)

日本語版メニュー
メインページ - Lazarus Documentation日本語版 - 翻訳ノート - 日本語障害情報


概要

すぐにでも Lazarus をインストールしプログラミングをはじめたい人たちのための、最も手軽な手法としては、 安定版としてリリースされている最新のバイナリーをダウンロードしてインストールすることです(Linux なら RPM パッケージ、Windows ならインストーラ、Mac OS X なら dmg パッケージなど)。Linux や Windows 環境のセクションにある“FPC バイナリ”と、Linux や Windows 環境への Lazarus のインストールのセクションの最初のパラグラフを読んでください:それ以外の箇所は読まなくても大丈夫です。 ただ、コンパイラや IDE の開発に参加しようとする方、最新のツールにアップデートしたい方は、ソースからのインストールが必要となり、残りの情報が関連してきます。

Lazarus は次の2つで構成されています。:

  • LCL - Lazarus コンポーネントライブラリ
  • IDE - RAD ツール(グラフィカルな開発統合環境)

下の略語は次のような意味です:

  • FPC - FreePascal コンパイラ
  • FCL - FreePascal コンパイラのライブラリ。Lazarus で使用するグラフィカルでないコンポーネントのほとんどが含まれています。

Lazarus システム要件

  1. FreePascal コンパイラ、パッケージ、ソースファイル。(*重要*: 同じバージョンで同じ日付のもの)
  2. ウィジェットツールキット
    Win32
    The native Win32 API can be used
    Linux/xxxBSD
    GTK+ 1.2.x : ほとんどの Linux ディストリビューションや *BSD(FreeBSDやNetBSDなど)はあらかじめ GTK+ 1.2.x ライブラリがインストールされています。またそれらは http://www.gtk.org から見つける事が出来ます。
    また gdk-pixbuf についても 0.13 以降のもの(できれば 0.18 以降のもの)があった方がいいでしょう。これらは過去2年から最も新しいディストリビューションから探し出すことができます。ソースは ftp://ftp.gnome.org/pub/GNOME/sources/gdk-pixbuf/ から入手することが出来ます。
    Mac OS X
    GTK+ 1.2.x : Apple のデベロッパーツール、X11、GTK1.2 が必要です。Mac OS X でのインストールの箇所を参照して下さい。
    GTK+ 2.x
    注意 : (lazarus の)GTK インターフェースはまだコンパイルされておらず、まだテスト段階です。
    最近のディストリビューションから見つける事が出来ます。ソースについては、http://www.gtk.org を参照して下さい。

The FAQ - FAQ(Frequently Asked Questions file:よくある質問) は http://www.lazarus.freepascal.org から参照できます。幾つかの質問はローカルファイルの'FAQ'から見つけることが出来ます。

以降のセクションは FreePascal の取得の方法と、Lazarus をどのように適切にインストールするかについて述べます。

Free Pascal コンパイラのインストール

この http://www.stack.nl/~marcov/buildfaq.pdf では、Free Pascal コンパイラをどのように構築し、どのようにインストールするかについて行われた膨大な議論を参照できます - これはおそらく何人かのユーザにはとても細かいことかもしれませんが、とても総合的なことです。

Lazarus は fpc (FreePascal) の 2.0.2 バージョン以降が必要ですが、さらに fpc ライブラリ(バイナリ)と同じバージョンの fpc ソースについても必要となります。

Linux 環境での Free Pascal のインストール

FPC バイナリ

FreePascal の最新リリースは version 2.0.2 であり、これは FreePascal の Web サイト(http://www.freepascal.org/download.html, ここからミラーサイトを選択します) 、もしくは SourceForge (http://sourceforge.net/projects/lazarus) から入手することが出来ます。

Lazarus のダウンロードセクション (http://www.lazarus.freepascal.org )では、パッケージ化された Free Pascal コンパイラ(linux用)の RPM ファイルを入手することが出来ます。もし RPM ベースのディストリビューションでないのなら、 http://www.freepascal.org から tar ファイル(ソースファイル) をダウンロードしてインストールすることができます。もし、自分でコンパイルしたい方は、BSD のセクションを参照して下さい。

インストール:

注意: もし RPM を使っていないなら(もし alien を使う計画であるなら)、最善の方法は、最新の安定版の fpc (現時点では2.0.2)を入手し、ソースから Lazarus をインストールすることです。

Linux を起動し、root でログインしてください。

http://sourceforge.net/project/showfiles.php?group_id=89339 から最新のファイルを取得してください。

例:

  • fpc-2.0.2-0.i386.rpm
  • fpcsrc-2.0.2-0.i386.rpm
  • lazarus-0.9.14-1.i386.rpm

これらをインストールします:

  • rpm -Uvh fpc-2.0.2-0.i386.rpm
  • rpm -Uvh fpcsrc-2.0.2-0.i386.rpm
  • rpm -Uvh lazarus-0.9.14-1.i386.rpm

Debian ユーザは alien もしくはソースからのインストールを行なう必要があります。 (注意:alien を使った場合、fpc.cfg は生成されません)

FPC ソース

バージョン2.0リリース版以降、FPC は Subversion(SVN)に移行しました。これは CVS ミラーを使用していません。FPC ソースを入手するには SVN を使用しなければなりません。

開発ツリーからのダイアリソーススナップショットのダウンロード(version 2.1.x)

SVN ソースリポジトリから、その日の 2.1.x 系の開発バージョンのスナップショットをダウンロードできます: これらのスナップショットは基本的に毎日更新され、ソースリポジトリに反映されます。これらのファイルはSVNアーカイブとしてサイト内で保管されます。 2.1.x 系のアーカイブの公開ソースはここから入手してください:fpc.zip (24 MB)

開発ツリーからのダイアリソーススナップショットのダウンロード (version 2.0.x)

SVN ソースリポジトリから、その日の 2.0.x 系の開発バージョンのスナップショットをダウンロードできます: これらのスナップショットは基本的に毎日更新され、ソースリポジトリに反映されます。これらのファイルはSVNアーカイブとしてサイト内で保管されます。 2.0.x 系のアーカイブの公開ソースはここから入手してくださいfpc.zip (24 MB)

SVNのソースリポジトリへの接続 (replaces section on connection to CVS)

As an alternative to the daily zip files of the SVN sources, the SVN repository has been made accessible for everyone, with read-only access. This means that you can directly access the code, and you will have really the last-minute sources available. It is also a method which requires less bandwidth once you have done the first download (checkout in SVN lingo).

Development snapshots

下に手順を述べます。 (当然、SVNをインストールしておく必要があります。一連のやり方については here を見てください)

開発に使用する領域の親ディレクトリに(cd コマンドで)移動してください。例えば次のようにします。

[]$ cd /home/username/FreePascal

全てのソースリポジトリ、全ての公開されたモジュールを取得するには、次のようにタイプします。

[]$ svn checkout http://svn.freepascal.org/svn/fpc/trunk fpc

普通はこのステップだけで済むはずです。

上述でダウンロードしたソースをアップデートする場合は次のようにします。

[]$svn update fpc
2.0.x への修正

修正を行なうには別のディレクトリを作成する必要があります。'fixes'という別のディレクトリを作成し、そこに移動します。そして修正用の URL http://svn.freepascal.org/svn/fpc/branches/fixes_2_0 を引数にして、上述のチェックアウトコマンドを実行します。

[]$ cd mysvn/fixes
[]$ svn checkout http://svn.freepascal.org/svn/fpc/branches/fixes_2_0 fpc

アップデートするには次のようにします:

[]$ svn update fpc

ドキュメントのソースは fpcdoc と呼ばれるリポジトリの方に置かれています。これは次のコマンドで入手できます。

[]$ svn checkout http://svn.freepascal.org/svn/fpcdocs/trunk fpcdocs

Subversion についてもっと学びたいのなら、フォーマットが異なるのですがオンラインで自由に読むことが可能な、すばらしい Subversion book を読んでください。

好奇心旺盛の方へ: 読み取り専用です。間違ってもコミットしようとしないように。

より多くの情報については、この Web サイトFreePascal をご覧下さい。

Windows 環境での Free Pascal のインストール

Windows 用 FPC バイナリ

Free Pascal を最も手軽にインストールする方法は、Sourceforge リポジトリから Lazarus のカレントバージョンの Windows バイナリインストーラをダウンロードすることです。このインストーラには、lazarus IDE だけでなくカレントバージョンの FreePascal コンパイラと FreePascal ライブラリが含まれています。 もしソースからのインストールを希望するなら、ここを読んでください!

Free Pascal のダウンロードセクション(http://www.freepascal.org/download.html, ここからミラーを選んでください)から fpc 2.0.2 の zip インストーラを入手できます。 ソースからのインストール -- 取得の方法について知りたいのなら次のセクションを見てください。初心者向きではありません。また始めるにはコンパイラが必要となります。

Windows 用 FPC ソース

<<<< 上述の Linux 用の FPC ソース を見て下さい。ここでは SVN の使い方について述べています >>>>

Fee Pascal のソースを取得するのに最も簡単な方法は、SVN を利用することです。これ以上については、次のセクションを見てください。パッケージの全てを取得することが出来ます -- 2.1.x デイリースナップショットのツリーについては http://www.freepascal.org/develop.html を見てください。

SVN を介した Windows 用の FPC ソースの取得

まず、TortoiseSVN のような SVN クライアントをインストールする必要があります。正確なコマンドは svn クライアントによって変わります。The exact commands vary between SVN clients; the ones given below are to be used under SVN home's client, which is available for download here.

まず、ソースを置く用のディレクトリを作成します。通常のユーザであればこれを実行するだけで構いません。fpc用のディレクトリ(例 c:\Source)を作成し、コマンドプロンプトで次のように実行します:

 C:\Source> svn co http://svn.freepascal.org/svn/fpc/trunk fpc

ヒント: 最新の状態のものをダウンロード/アップデートしたいなら、次のようなシンプルな方法で出来ます

 C:\> cd Source\FPC
 C:\Source\FPC> svn up

ToDo: Write me.

http://www.freepascal.org/down-win32.html を参照して下さい。http://www.freepascal.org/sdown.html ではミラーのリストを見つけることが出来ます。FPC は大きなファイルですが、これをダウンロードして、unzip で解凍し、install.exe を実行して下さい。

fpc ディレクトリにパスを通して下さい:

  • Win98: autoexec.bat を編集し、PATH=%PATH%;C:\pp\bin\bin\win32 を加えて下さい
  • WinXP/2k: マイコンピュータを右クリックし、プロパティー->詳細設定->環境変数を選択し、システム環境変数にある PATH の項目に、"C:\pp\bin\bin\win32" を追加して下さい

設定後、Windows を再起動します。

ToDo: Explain how to download fpc sources and build the compiler

FreeBSD 環境への Free Pascal のインストール(自動)

最新の FreeBSD ports コレクションは、ports/lang/fpc2 に 2.0.2(もうすぐ2.0.4)の安定バージョンが登録されています。殆どの場合、この port をインストールする必要があります。もし Lazarus を使用とするなら"gtk"をまずインストールする必要があるのですが。

手動でするなら root で次のように実行します:

[]# cd /usr/ports/lang/fpc2 && make install && make clean

他の手法は portinstall を使うことです。

[]# portinstall fpc2

一度 fpc をインストールすれば、シンプルなコマンドを実行することで動作チェックをすることができます。

[]$ fpc

しかしながら、FreeBSD と FPC の間には1つ問題があります。port はすべてのパッケージと FCL をインストールするのですが、(lazarus で必要となる)glib と gtk の最新の ports ツリーでは名称変更がなされているのです。これは lazarus でリンク処理をする際に、"cannot find library -lglib" というエラーメッセージが発生することを意味しています。次の2つの方法のうちどちらか1つで修正することができます。

1. fpc ソースの中の該当箇所を修正し、りコンパイルする[推奨しません]
2. 従来のライブラリ名称へのシンボリックリンクを作成する

2. の方法については、次のように行ないます。

[]$ cd /usr/local/lib && ln -s libglib-12.so libglib12.so
[]$ cd /usr/X11R6/lib && ln -s libgtk-12.so libgtk12.so

この変更をしてから、Lazarus でコンパイル・リンクを行なって下さい。

BSD 環境 での Free Pascal のインストール(手動)

Effectively, you need

A file with all sources, or two (fpc and lazarus)

1. e.g. for fpc ftp://ftp.freepascal.org/fpc/dist/Linux/separate/sources.tar preferably an export (no CVS/ dirs). The above file misses this.
2. Lazarus のソースのスナップショット

  • _any_ starting compiler from the 2.0.2 branch) You can do a check by parsing the output of ppc386 -i if it is 2.0.2 .. 2.1.x it is ok.
  • - dependant packages. (for FreeBSD that is gtk12, glib12 and gdk_pixbuf and GNU make, iconv and gettext)

FPC の構築:

1. (fetch) necessary files (FPC source, starting compiler)
2. (extract) Then de-tgz in work directory,
3. (build) enter work/fpc/ and run

 $MAKE all OPT='-gl -O3p3'  PP=/path/to/startingcompiler-name-ppc386
(/path/to/ can be omitted when ppc386 is in the path)
($MAKE is make on linux and gmake on BSD)

4. (install) then, again in work/fpc, run

$MAKE install PP=compiler/ppc386 PREFIX=$THEPREFIX
(THEPREFIX= usually is /usr/lcoal, but e.g. on NetBSD it is /usr/pkg for ports)
Create a symlink:
  ln -s $THEPREFIX/lib/fpc/2.0.2/ppc386 $THEPREFIX/bin/ppc386
     install sourceinstall PREFIX=$THEPREFIX

5. (configure) run compiler/utils/samplecfg $THEPREFIX/lib/fpc/2.0.1 $ETCDIR
6. (optional, test), see if ppc386 -i gives output, else give a warning that user need to add $PREFIX/bin to his current path. Try to compiler a program with -viwn, and see if that gives errors. Notes:

  • If you need fpcmake package lists, you need to generate or supply them yourself, (in the port, or in an extra archive) either way, do a dummy install to /tmp/pack and determine the files installed with find . >ll
  • $THEPREFIX and $ETCDIR should be user configurable. Otherwise local installs aren't possible.
  • BSDHIER=1 on all make commands forces BSD hierarchy conventions.

Mac OS X 環境での Free Pascal のインストール

Mac OS X の場合、他に Apple Developer tools、X11、GTK 1.2 が必要となります。

Developer-tools は OS X のインストレーション CD の中に含まれています。もしくは、Apple の ADC(無償だが要登録)に参加し、ダウンロードするという方法があります。http://developer.apple.com/ 参照。

Apple X11: 新しいシステムの場合: インストールダイアログの中で"カスタマイズ"を選び、"X11"にチェックを入れて下さい。

On an already installed system:

MacOSX 10.3: 次のサイトからダウンロードして下さい。

http://www.apple.com/downloads/macosx/apple/x11formacosx.html

MacOSX 10.4: 付属の DVD から X11 をインストールして下さい。

GTK 1.2: Downloading the GTK packages and installing them properly can be a time consuming task. Therefore there are various package managers. One of them is fink:

Download fink from http://fink.sourceforge.net/download/index.php?phpLang=en; follow the install instructions.

ターミナル上で次のコマンドを実行して下さい。

       sudo /sw/bin/apt-get install gdk-pixbuf gtk+ gtk+-data gtk+-shlibs gtk-doc gtk-engines

X11 アプリケーションは /Applications/Utilities/X11 にインストールされます。ドラッグ&ドロップでドックに置いておけば、いつでもクリック1回で起動できます。

Tip: lazarus を含めてほとんどの X11 プログラムは、ユーザが Window 上をクリックした際にフォーカスが取得できることを前提にしています。MacOSX 上では、これは非アクティブにされています。ターミナル上で次のコマンドを実行することで、すべての X11 アプリケーションでこれをアクティブにすることができます。

       defaults write com.apple.x11 wm_click_through -bool true
Free Pascal Compiler

次の URL から Free Pascal Compiler (バージョン2.0.2) をダウンロードし、インストールします:

https://sourceforge.net/project/showfiles.php?group_id=89339

GTK 関連のソフトウェアをコンパイルする時には、次の2行を fpc.cfg ファイルに追加してライブラリを有効にする必要があります:

-Fl/sw/lib
-Fl/usr/X11R6/lib

For Lazarus you need the FPC sources as well:

  • MacOSX 用の SVN のインストール: おすすめのパッケージがこのサイト Martin Ott から配布されています。

ディレクトリを作成し、ソースをここに置きます。root でこれをする必要はありません。普通のユーザアカウントで構いません。 最初に fpc 用のディレクトリを作成します。

(e.g. /Users/username/freepascal)

そしてターミナルを開き次のコマンドを実行します。

[]$ svn co http://svn.freepascal.org/svn/svn/trunk fpc

これにより 'fpc' という名前のディレクトリが作成されます。これは後で IDE から使用されます。

ヒント: 最新のダウンロード/アップデートに更新するには、次のようなシンプルな方法で実施します

[]$ cd /Users/username/freepascal/fpc
[]$ svn up

Lazarus のインストール

Linux 環境での Lazarus のインストール

RPM を用いたインストール

Lazarus の現行のインストーラを取得することが最も簡単な方法で、それは SourceForge のリポジトリから FreePascal と Lazarus の RPM をダウンロードすることです。

指定のバージョンをダウンロードする必要があります

  • コンパイラ (eg fpc-1.9.5-041207.i386.rpm)
  • pascal ソースライブラリ (eg fpcsrc-1.9.5-041207.i386.rpm)
  • lazarus パッケージ (eg lazarus-0.9.2.4-fpc_1.9.5_041207.i386.rpm).

次のコマンドを実行してください(rootで実行する必要があります。su もしくは sudo を使用してください)

rpm -Uvh fpc-1.9.5-041207.i386.rpm
rpm -Uvh fpcsrc-1.9.5-041207.i386.rpm
rpm -Uvh lazarus-0.9.2.4-fpc_1.9.5_041207.i386.rpm

Suse 10.1 ユーザのためのLazarus 0.9.16 のインストール:

Linux を起動し、root でログインします

Free Pascal コンパイラは次のものが必要です: - Gnu バイナリ (gnu as, gnu ld, gnu make) - "YAST" を使って確認してください

バイナリファイルをダウンロードします(RPM)

  • fpc-2.0.2-0.i586.rpm (yes i586 and not i386)
  • fpcsrc-2.0.2-0.i386.rpm

ターミナルを開き、それをインストールします(マウスの右ボタン -> Menu: terminal を開く)

  • rpm -Uvh fpc-2.0.2-0.i586.rpm
  • rpm -Uvh fpcsrc-2.0.2-0.i386.rpm

Lazarus のインストールには次のコンポーネントが必要です: 1) glib devel
2) gtk devel
3) gdk-pixbuf-devel
4) gtk+-devel.
最後のコンポーネントは、SUSE では動かないようで、一旦、-nodeps オプションを付けて強制的にインストールした3つのコンポーネントをインストールしなければなりませんでした:

  • rpm -Uvh --nodeps lazarus-0.9.16-1.i386.rpm

ソースからのインストール

If you prefer to install from source and compile the files yourself, follow these instructions. Because the whole lazarus stuff is installed into one directory, uninstall is very easy and you don't need to be root to install lazarus. You can get tgz files for fpc, fpcsrc and lazarus from the downloads section or you can download it directly via svn.

Lazarus SVN のダウンロード

The lazarus repository has moved from cvs to svn (Subversion). SVN provides an easy way to update your sources by only downloading the changes. This is the recommended way and saves you a lot of time. A connection to the internet is needed for this: you don't need to be root. Lazarus does not need any special permissions, neither during installation nor at runtime.

With the move we also changed the directory layout of the lazarus sources. The main difference is that all ide sources are moved from the root to a separate ide subdir. As anybody might understand, this has an impact on the Makefiles, the searchpaths etc. We are in progress of fixing things, so if something doesn't work, please let us know.

Now the most important thing.... getting the sources
 []$ svn checkout http://svn.freepascal.org/svn/lazarus/trunk/ lazarus

(or any other dir where you want to place your sources)

On subsequent occasions, to update simply type

 []$ svn update lazarus

For more information on Subversion, see: http://subversion.tigris.org/

Note: the CVS is still accessable, but it frozen. This means that no new updates are comitted.

コンパイルと実行

cvs もしくは svn のどちらからのチェックアウトであっても、次のステップとなります:

lazarus をコンパイルする
[]$ cd lazarus
[]$ make  (gmake on BSD)

fpc が正しくインストールされていれば、コンパイラは問題なく動くはずです。そうでなければ FAQ を見て下さい。

lazarus を起動する
[]$ ./lazarus

The IDE should start. If you started lazarus in a terminal, you can see some notes about missing settings. This is normal at first start. The IDE automatically tries to find out where the freepascal compiler and its sources are installed by searching in the most common directories.

パスを確認して下さい
IDE メニューを使って次の通り進みます
Environment -> Environment Options -> Files

The 'FPC Source directory' should point to your fpc source directory. This directory normally ends with /fpc/ or /fpcsrc/ (e.g. /usr/src/fpcsrc or /home/username/freepascal/fpc) and contains directories like 'compiler', 'docs', 'fcl', 'rtl' and 'packages'.

ToDo: explain the other paths

ヒント

lazarus をアップデートするなら次の通りにします

[]$ svn update lazarus

then for either update pathway:

[]$ make clean all   (gmake on BSD)

This will rebuild lazarus and create an IDE without lazarus packages. To link your installed packages do after the above:

[]$ make idepkg

Debian GNU/Linux 環境への Lazarus のインストール

There are preliminary Debian packages for lazarus available for download. They are not the latest versions, however. Make sure you read /usr/share/doc/lazarus/README.Debian carefully before you start using it. Feedback is needed and appreciated; please send your comments to Carlos Laviola <claviola@debian.org>.

Note that for a fully working Lazarus install, no older or incompatible versions of, for example, the fpc source or fpc compiler must be installed. Remove them by typing

 dpkg -r <package name>   

without .deb extension. And then install the newest versions as described.

Debian 環境への Lazarus をインストールする別の方法

Added by User:Kirkpatc.

Debian 環境で簡単に Lazarus をインストールする方法です

(assume new Debian installation, without development libraries loaded)

SourceForge のリポジトリから fpc、fpclib、lazarus リリース版の最新をダウンロードします; http://lazarus.freepascal.org にアクセスして、"downloads" をマウスの左ボタンでクリックし、"binaries" をクリック、次に "linux"、次に "Current Lazarus RPM" をクリックします。This will bring you to

http://sourceforge.net/project/showfiles.php?group_id=89339

そして次のファイルをダウンロードします(より新しいものがあればそれをダウンロードして下さい)

  • fpc-2.0.0-0.i586.rpm
  • fpcsrc-2.0.0-0.i386.rpm
  • lazarus-0.9.8-fpc_2.0.0_0.i386.rpm

cd to the directory where these files are stored, then become root (su) and type:

alien -c fpc*     //this will convert both the fpc and fpcsrc files to debian format and convert the install scripts
alien -c laz*

そして、作成された Debian パッケージ(.deb)を root 権限でインストールします:

dpkg -i fpc*.deb laz*.deb

or use kpackage or a similar utility to install the generated fpc, fpcsrc and lazarus .deb files.

もし alien がインストールされていないのなら次のようにします:

apt-get install alien 

Please note that, on Linux distributions like Ubuntu, you'll have to add 'sudo' in front of all commands. In Ubuntu previous command would be

sudo apt-get install alien

You need to produce a configuration file, which will reside in /etc/fpc.cfg. Still as root, cd to the main fpc directory /usr/lib/fpc/2.0.0 and then type

sh ./samplecfg /usr/lib/fpc/2.0.0 /etc

Check the contents of your new configuration file (cat /etc/fpc.cfg) and make any changes you want using vi or another text editor. Also make sure that there are no old configuration files in for example your home directory (~/.fpc.cfg).

GTK と pixbuf ライブラリの開発パッケージをインストールする必要があります。

apt-get install libgtk2.0-dev
apt-get install libgdk-pixbuf-dev

これでプログラミングをはじめることが出来ます!

Installing Lazarus under Mac OS X

Works pretty much the same as under Linux. But you first need to install the Apple developer tools, X11, and GTK 1.2.

Easy-to-install snapshots are also available at http://www.de.freepascal.org/lazarus/.

If you install all 3 .dmg snapshot files, this also installs the FPC compiler and the FPC and Lazarus source too. If you only need to run Lazarus to develop and compile your own apps, you don't need to install the FPC and Lazarus sources as described above. If you need to rebuild Lazarus or want to help with its development, then you should to install the Lazarus source to a folder where you have read-write permission, as described above.

If you want to experiment and develop the Carbon widgetset interface, look at Carbon Interface.

There are at least two ways to start Lazarus under OS X:

Start X11. In the terminal window, type:

cd /usr/local/share/lazarus
./lazarus

You can also run Lazarus from the X11 menu. Choose Applications | Customize, click Add Item, then under Name enter Lazarus and under Command enter:

open -a /usr/local/share/lazarus/lazarus

Click Done. Now you can start Lazarus by choosing Applications | Lazarus.

Windows 環境での Lazarus のインストール

Windows 版 Lazarus の現行バージョンのインストールは非常に簡単で、きっとビックリするでしょう。

もし使用する Windows 上にソフトウェアをインストールすることが許容できないか、管理者権限がなくてインストールできないといった場合、256 MB 以上の USB ドライブに Lazarus/FPC パッケージをインストールして使用することも可能です。この場合、コンパイラや環境設定オプション、fpc.cfg ファイルなどで、パスの指定に注意する必要があります。また USB ドライブ上にテスト用のディレクトリを用意し、保持しておいた方がいいと思います。 << DOES ANYONE KNOW HOW TO SET UP RELATIVE PATHS IN THESE TAGS AND FILES, SO THAT THE ADDRESSING WORKS WHEN YOU MOVE THE USB DEVICE TO ANOTHER MACHINE WHERE IT HAS A DIFFERENT DRIVE LETTER? >>

Linux 用、Windows 用のバイナリーパッケージは次の URL からダウンロードできます。

http://sourceforge.net/project/showfiles.php?group_id=89339

最新のリリースのもの(現在は Lazarus-0.9.15-20060415-win32.exe)をダウンロードし、これを実行して下さい。

典型的な Windows インストールでインストールできます。以前のバージョンの Lazarus と FPC(多くの場合 c:\pp ディレクトリにあります)をアンインストールしておけば、特に致命的な問題もなく、FPC コンパイラとソースライブラリが Lazarus のディレクトリ構成と同じディレクトリの中にインストールされ、IDE が起動します。

Windows 用のスナップショットはここから取得できます: http://www.de.freepascal.org/lazarus/

ソースからのインストール

もしソースからインストールを参照したければ、これらの説明を見て下さい (Thanks to Joe for the initial Step-by-step description)

lazarus のソースをダウンロードする必要があります:

http://www.de.freepascal.org/lazarus/

そして、たとえば c:\lazarus に解凍して下さい。なお、fpc-2.0.2 をインストールしておく必要があります。fpc-2.0.3 もしくは fpc-2.1.1 のスナップショットでも構いません。これは私(筆者)用のコンパイルで、lazarus.exe を実行しています。私の fpc のパスは c:\pp\bin\win32 です。このディレクトリには沢山の実行ファイル(make, grep, ppc386 など)が置かれています。

コマンドプロンプトを起動します。スタートメニュー->全てのプログラム->...->MS-DOS のアイコンのコマンドプロンプトを選択します。

次のようにタイプして下さい:

cd c:\lazarus
set path=c:\pp\bin\win32;c:\lazarus  //もちろん、ここはあなたの環境に合わせて
                                     //書き換えて下さい
windres -i lazarus.rc -o lazarus.res
make

If you are lucky then you can type: lazarus.exe. The source editor, dialogs and the property editor work, but not perfectly... Look and you will see.

サンプルは次の手順でコンパイルします:

cd examples
make

If you extracted lazarus to another drive, eg.: d:\lazarus. It can happen that you need the gnu utility to make it. If you have it, you can take its path to set path=...;<gmakepath> but it is simpler not to choose drive d:\

これで全てです。

Additional experiences and advice on installing FPC and Lazarus

On linux, getting Lazarus to work can be complicated. If you have already installed earlier versions of FPC and/or Lazarus, you have to take great care that the PATHS are adjusted so that only your new versions are called.

私が SuSE Linux 上で様々な試みから経験した落とし穴についてです:

rpm バージョンは場合によっては FPC を /bin や /usr/bin に、ライブラリを /lib や /usr/lib にインストールします。 もし .tar.gz を使ってソースバージョンからインストールしたら、デフォルトでは実行ファイルを /usr/local/bin に、ライブラリを /usr/local/lib にインストールします。

So if earlier versions have been installed from rpm, make sure all links are changed to reflect the directory structure of your new compiler. The place to make the changes is in /etc/fpc.cfg ; make sure there are no remnant configuration files in your home directory or in your FPC download directory. Typically they are found in ~/.fpc.cfg

Make sure the links in /etc/fpc.cfg point to the correct versions of the libraries (particularly if you have older versions still lurking around).

In /usr/local/bin or /usr/bin there is a file called fpc ; this is the executable that is called when you invoke the compiler. One of the first things it does is to open ppc386 in the same directory. This has to be the same version as the fpc file, or can be a link pointing to the true ppc386 in some other directory (such as a library directory, or the fpc directory in your own development space); be sure to update your link if you install a newer version of the compiler.

Try running the compiler from the command line using one of the simple example programs or one which you wrote yourself.

Turning to Lazarus:

If you use a downloaded snapshot (.tar.gz) or get the source from CVS, enter your lazarus directory and type

make
./lazarus 

and hopefully the IDE should load. There may be a message saying it can't find the sources; if so, go to the menu at the top and select Environment -> Environment options and insert the name of the directory where you expect to find your lazarus files (eg ~/FreePascal/lazarus), your compiler (eg /usr/local/bin/ppc386), the FreePascal source directory (eg /usr/local/lib/fpc/$version/fpc or a directory in your own space eg ~/FreePascal/fpc). Then close the dialog and start programming.

You may find further problems when you start programming or compiling; most of these will be related to PATH selection.

Many of the difficulties are dealt with in the Lazarus FAQ, found either on this WiKi site, or a more complete list on the main Lazarus site

http://www.lazarus.freepascal.org/modules.php?op=modload&name=FAQ&file=index

From the top menu select Run -> Compiler Options (or Project -> Compiler Options in more recent releases of Lazarus) and select the Paths tab on the resulting dialog. There are several boxes for entry of paths for Unit files, Include files, Other source files, Libraries etc. For each of these, it is worth pressing the ... (ellipsis) button on the right, and you will be given a blank window for inserting path information, and a lower window giving some suggestions. Select as many as you like (or ALL!) and press the ADD button to transfer the selections to the upper window. When your selection is complete, press OK and move on to the next box. If you know of other paths which need to be followed, press the Browse button associated with each box, and insert the additional paths.

When you think you have got your paths right, try to compile your application. If there are further path-related errors ('can't find unit .......') then go back and check your paths, both in /etc/fpc.cfg and in your Run -> Compiler Options dialog (or Project -> Compiler Options depending on your version).

Once you have got the environment and PATHS correct, it is worth saving the settings to a file, otherwise you will have to go through this process for each new project. In the Run -> Compiler options dialog there is a Load/Save button; select this and then save the setings to the filename of your choice: mine is ~/FreePascal/default.cfg. Then each time I start a new project, I can go to the Run -> Compiler Options dialog (or Project -> Compiler Options), select Load/Save, and load my default.cfg file to the new project. You can, of course, modify the options for each new project if you so desire.

BSD 環境での Lazarus のインストール

FreeBSD 4.10+

上のテキストでも述べていますが、まず GTK+ 1.2 をインストールしておく必要があります。私はそれをしていなかったので、まず最初に root になってこれをインストールしました:

> pkg_add -r gtk
> pkg_add -r gdk-pixbuf
> cd /path-to-lazarus
> gmake
> ./startlazarus

もしソースファイルがないというメッセージがでたら、[menu bar >> Environment >> Environment Options >> Files Tab: FPC source library] に進み、FPC のソースファイルのあるディレクトリに移ってください。私は上で述べたように SVN からそれを入手しました。

Good luck, that worked for me. --Jrmarino 21:29, 4 Jan 2006 (CET)

6.0 でも同じ方法です。しかし、これには2つの潜在的な問題があります。

1. 起動後、lazarus のソースエディタでいくつかの壊れたフォントがあるように見えます。これはフォントの指定が間違っているためです。修正は簡単です。エディタオプションに進み、他の他のフォントを選択してください。(clean works for me).

2. もしパッケージとlazarus のセルフビルド機能を使用したいのなら、Linux とは異なり、自分で環境オプションでgmake (make ではなく) のパスを明示的に指定しなければなりません。

PC-BSD 1.0rc1+

PBI Dirから Lazarus PBI をダウンロードして、PB-BSD 上にインストールすることが出来ます。

注意として、/usr/port/devel/glib* にある glib* ポート、もしくは pkg_add -r glib12 glib20 を実行して glib パッケージをインストールする必要があります。 私は新しい PBI リリースでこれを修正するつもりです。

[他の OpenBSD/NetBSD/DragonFlyBSD はここから]