출처: Cross compiling on Lazarus IDE (toradex.com)
Cross compiling on Lazarus IDE
Cross compiling on Lazarus IDE Article updated at 22 Oct 2019 Subscribe for this article updates Lazarus is a free cross-platform visual integrated development environment (IDE) for rapid application development using the Free Pascal compiler. The purpose
developer.toradex.com
Introduction
Lazarus is a free cross-platform visual integrated development environment (IDE) for rapid application development using the Free Pascal compiler.
The purpose of this article is to explain how to cross compile for ARMv7 an application written in Pascal using the Lazarus IDE.
Dependencies
On Ubuntu 18.04, The following command can be used to install the needed dependencies:
$ sudo aptitude install make binutils build-essential gdb subversion zip unzip libx11-dev libgtk2.0- dev libgdk-pixbuf2.0-dev libcairo2-dev libpango1.0-dev
Install fpcupdeluxe
fpcupdeluxe is a tool that can be used to install multiple versions of FPC and Lazarus in an easy way.
Download the most recent version of fpcupdeluxe from here, give it executable permissions and run it on your host machine.
$ chmod +x fpcupdeluxe-x86_64-linux $ ./fpcupdeluxe-x86_64-linux
Select the version for both FPC and Lazarus then click on the install button. The following image represents a successful installation log:
-
FPC and Lazarus successful installation log
Next, select the CPU and the OS for the compiler on the Cross tab, in this case we will choose the arm CPU and the linux OS. Finally, press the Install compiler. Below is an image representing a successful installation log:
Compiler successful installation log
Cross compiling
A Lazarus executable should have been created on your computer home directory, to open the Lazarus IDE just run it:
$ cd ~ $ ./Lazarus_fpcupdeluxe
For configuring the compiler options, go to Project -> Project Options -> Compiler Options -> Config and Target and change the fields on the Target platform topic, see below:
Compiler successful installation log
After compiling your program, you can check if everything went well using the file command:
$ file project1 project1: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-, for GNU/Linux 2.0.0, not stripped
'언어 > Lazarus' 카테고리의 다른 글
fpcupdeluxe (0) | 2021.02.19 |
---|---|
Lazarus IDE on ARM Ubuntu (Raspberry Pi, Ubuntu Touch, etc) (0) | 2021.02.18 |
윈도우10에서 콤보박스 한글처리시 문제...? (0) | 2021.02.03 |
Bluetooth (0) | 2021.01.10 |
Linux-arm cross compiler for original Raspberry Pi ARMV6Z and FPV2 #148 (0) | 2021.01.07 |