标签:
2015年2月推出的Raspberry Pi2不能用以前的方法安装Lazarus,当安装fpc时出现下面的问题停止安装。
从http://otapi.com/2015/02/10/raspberry-pi-2-freepascal-lazarus-and-delphi/找到解决方法:
1.安装subversion和unzip
Sudo Apt-get update
Sudo Apt-get install subversion unizp
2.获取和编译最新的FreePascal编译器
Sudo mkdir /usr/local/fpc
cd /usr/local/fpc
Sudo wget -O fpc-2.6.4.arm-linux.tar ?http://sourceforge.net/projects/freepascal/files/Linux/2.6.4/fpc-2.6.4.arm-linux.tar/download
Sudo tar xvf fpc-2.6.4.arm-linux.tar
cd fpc-2.6.4.arm-linux
Sudo ./install.sh
提示安装下列时,输入?后的内容
Install prefix (/usr or /usr/local)? /usr/local
Install textmode IDE(y/n)?y
Install FCL(y/n)?y
Install Packages(y/n)?y
Install Documentation (y/n)?y
Install Demo (y/n)?y
下载最新版FPC:
cd /usr/local/fpc
Sudo svn co ?http://svn.freepascal.org/svn/fpc/trunk trunk
Sudo svn export --force trunk trunktmp
cd trunktmp
编译FPC:
Sudo make all OPT=-dFPC_ARMHF
Sudo make install OPT=-dFPC_ARMHF PREFIX=/usr/local
Sudo make install sourceinstall OPT=-dFPC_ARMHF PREFIX=/usr/local
cd /usr/local/lib/fpc
ls
你在 Terminal应看到最新版本的版本号:
2.6.4 3.1.1
用看到最新的版本号替换下面的3.1.1(现最新的版本号为3.1.1)
Sudo rm -f "/usr/local/bin/ppcarm"
Sudo ln -sf "/usr/local/lib/fpc/3.1.1/ppcarm" "/usr/local/bin/ppcarm"
3.编译及安装最新Lazarus Version
Sudo apt-get update
Sudo apt-get install libx11-dev libgdk-pixbuf2.0-dev libcairo2-dev lpango-1.0 libpangox-1.0-dev xorg-dev
Sudo aptitude install libgtk2.0-dev libgdk-pixbuf2.0-dev libpango1.0-dev
Sudo mkdir /usr/local/lazarus
cd /usr/local/lazarus
Sudo svn co http://svn.freepascal.org/svn/lazarus/trunk trunk
Sudo svn export --force trunk trunktmp
cd trunktmp
Sudo make all OPT=-dFPC_ARMHF
Sudo make install OPT=-dFPC_ARMHF PREFIX=/usr/local
4.最后的设置:
When you first launch Lazarus, it’ll ask for the path to the FPC sources. Enter /usr/local/fpc/trunk then you’re ready to go!
经过长达3小时的安装, Lazarus终于安装完成。
当你第一次启动Lazarus, 要求设置FPC sources,输入 /usr/local/fpc/trunk
编译后的程序运行情况:
Raspberry Pi 2 安装最新版FPC和Lazarus 1.5
标签:
原文地址:http://www.cnblogs.com/qiufeng2014/p/4313426.html