[Lazarus] Thread support in package in MacOS 10.5

Roland Turcan konf at rotursoft.sk
Fri Sep 5 09:00:00 CEST 2008

Hello Reenen,

Thanks for your fast response. Of course I know, that I need to add
"cthreads" into program which I want to build with thread support, but
maybe you didn't realize, that I wrote about package of components to
be built into Lazarus.

You know, that MyPackage.pas file is generated automatically from LPK
file and it contains this:

RL> { This file was automatically created by Lazarus. Do not edit!
RL> This source is only used to compile and install the package.
RL>  }


<<< 5.9.2008 8:33 - Reenen Laurie "rlaurie at gmail.com" >>>

>From here:

Units needed for a multithreaded application

You donĀ“t need any special unit for this to work with Windows. However with Linux, Mac OS X and FreeBSD, you need the cthreads unit and it must be the first used unit of the project (the program unit, .lpr)!

So, your Lazarus application code should look like: 

program MyMultiThreadedProgram;
{$mode objfpc}{$H+}
{$ifdef unix}
  Interfaces, // this includes the LCL widgetset
  { add your units here },

I am assuming that the $ifdef unix doesn't return true for Mac OS X, but I am sure there is one that checks if it's a Mac...


On Fri, Sep 5, 2008 at 8:17 AM, Roland Turcan <konf at rotursoft.sk> wrote:
> Hello lazarus project!
> I added some components into package which have some threads inside,
> but after building lazarus, lazarus shows the message:
>> This binary has no thread support compiled in.
>> Recompile the application with a thread-driver in the program uses
>> clause before other units using thread.
> But where to put into package thread support?
> Thanks.
> --
> Best regards, TRoland
> http://www.rotursoft.sk
> http://exekutor.rotursoft.sk
> _______________________________________________
> Lazarus mailing list
> Lazarus at lazarus.freepascal.org
> http://www.lazarus.freepascal.org/mailman/listinfo/lazarus

,_.>/ _
...speed is good
I believe five out of four people have a problem with fractions.

Best regards, TRoland

More information about the Lazarus mailing list