Sven Barth wrote 15 lines
> 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