[Lazarus] Crosscompile to Android on arm?

Bo Berglund bo.berglund at gmail.com
Fri Jul 27 08:21:56 CEST 2018


On Thu, 26 Jul 2018 10:26:27 +0200, Sven Barth via Lazarus
<lazarus at lists.lazarus-ide.org> wrote:

>> For example in some console apps I have made also for both Windows and
>> Raspbian I have this in the lpr file:
>>   {$IFDEF UNIX}
>>     {$IFDEF UseCThreads}
>>     cthreads,
>>     {$ENDIF}
>>   {$ENDIF}
>>
>> If that is needed also here, where should it be put?
>>
>
>Also in the main project file in front of any other units. If your program
>indeed uses threads (don't know whether Indy uses them) then you'll also
>either need to add UseCThreads to the project defines or remove the "$ifdef
>UseCThreads" so that the cthreads unit is always used on Unix-like systems.

Indy does use threads extensively...
Since I could not find any place to set a project wide defined symbol
UseCThreads I did this instead in the lpr file:

program WiFiConfig;

{$mode objfpc}{$H+}

uses
  {$IFDEF UNIX}
  cthreads,
  {$ENDIF}
  Interfaces, // this includes the LCL widgetset
  Forms, indylaz, FormMainConfig, wificommhandler
  { you can add units after this };

{$R *.res}

begin
  RequireDerivedFormResource := True;
  Application.Initialize;
  Application.CreateForm(TfrmMainConfig, frmMainConfig);
  Application.Run;
end.

After this the program does no longer crashes when I try to connect to
the device, but it does not connect either because I am having
problems making OpenVPN to the network where the device lives work
from the RPi box.
I have to solve this somehow, it works fine from my Windows7 PC so
there I can interact with the device.
Problem for another forum, though.

-- 
Bo Berglund
Developer in Sweden



More information about the Lazarus mailing list