1.推荐用fpcupdeluxe安装lazarus,从https://github.com/newpascal/fpcupdeluxe/releases/latest 下载适合的版本
如果第一次在linux运行fpcupdeluxe需配置一下运行环境:
- GNU make
- the binutils (make etc); e.g. in a package called build-essential
- GIT client
- bunzip2 (probably present in most distributions)
- unzip
- untar
- subversion client: svn
- gdb is not needed for building FPC/Lazarus but needed for debugging your Lazarus programs
- libX11, libgdk_pixbuf-2.0, libpango-1.0, libgdk-x11-2.0
E.g. on Debian or Ubuntu, do something like:
sudo apt install make binutils git build-essential gdb subversion zip unzip libx11-dev libgtk2.0-dev libgdk-pixbuf2.0-dev libcairo2-dev libpango1.0-dev
建议FPC和Lazarus选择stable
安装成功后可以安装下面2个插件,Lazarus的界面就像delphi XE一样
安装插件前的界面和D7一样:
安装插件后的效果:
2.lazarus安装成功后,切换到Cross页面,选择需要的CPU和OS,然后点"install compiler",最后看到:SUCCESS: Fpcupdeluxe ended without errors. 指定平台就添加成功。
3、打开lazarus--Project--Project Option--Compiler Options--Config and Target--Target platform选择生成的OS和CPU
4、最后编译就能生成指定平台的执行文件。
在windows编译后程序在树梅派运行的效果: