Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2008-09

Thread support in package in MacOS 10.5

6 messages · 5 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Roland Turcan

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.

Reply by email

Reenen Laurie
to Roland Turcan

:

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+}
uses
{$ifdef unix}
cthreads,
{$endif}
Interfaces, // this includes the LCL widgetset
Forms
{ 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...

Regards,
-Reenen

Roland Turcan wrote 23 lines
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 http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
o__ ,_.>/ _ (_)_\(_)_______ ...speed is good _______________ I believe five out of four people have a problem with fractions. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20080905/fc363b7f/attachment.html

Reply by email

Roland Turcan
to Reenen Laurie

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> }

TRoland;

<<< 5.9.2008 8:33 - Reenen Laurie "" >>>

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+}
uses
{$ifdef unix}
cthreads,
{$endif}
Interfaces, // this includes the LCL widgetset
Forms
{ 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...

Regards,
-Reenen

Roland Turcan wrote 23 lines
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 http://www.lazarus.freepascal.org/mailman/listinfo/lazarus
o__ ,_.>/ _ (_)_\(_)_______ ...speed is good _______________ I believe five out of four people have a problem with fractions. -- Best regards, TRoland http://www.rotursoft.sk http://exekutor.rotursoft.sk

Reply by email

Luca Olivetti
to Reenen Laurie: : Units needed for a multithreaded application You don?t need any special unit for this…

En/na Reenen Laurie ha escrit:

So, your Lazarus application code should look like:

Roland's problem is, it's not his application code but lazarus itself. Besides, projects using those components should also have threads enabled, maybe it's just a matter of using -dUseCthreads in the custom options tab of the package.

Bye

Luca Olivetti Wetron Automatizaci?n S.A. http://www.wetron.es/ Tel. +34 93 5883004 Fax +34 93 5883007

Reply by email

Vincent Snijders
to Roland Turcan: Hello lazarus project! I added some components into package which have some threads…
Roland Turcan wrote 10 lines
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?

Add -dUseCThreads to the usage options of your package.

Lazarus and LCL applications using the default template will pick it up.

Vincent

Reply by email

Graeme Geldenhuys
to Vincent Snijders
Vincent Snijders wrote
Add -dUseCThreads to the usage options of your package. Lazarus and LCL applications using the default template will pick it up.

I use packages that require threading support as well. My Lazarus IDE also complained about that problem, and the above change resolved the issue for me. It should for you as well.

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email