Lazarus

Programming => Operating Systems => Mac OS X => Topic started by: saml on June 19, 2015, 09:01:43 pm

Title: [SOLVED] Missing cthreads on OS X Yosemite (Lazarus 1.4)
Post by: saml on June 19, 2015, 09:01:43 pm
I'm trying to get Lazarus 1.4 working on Mac OS X Yosemite (10.10.3) (running on macincloud.com), but keep getting problems.

I have installed FPC, FPC Source, and Lazarus, in that order, from the downloads at SourceForge.

Versions:
Lazarus: 1.4.0 i386-darwin-carbon
FPC: 2.6.4
OS X: Yosemite (10.10.3)

When compiling, I get an error message, saying:
"Semaphore init failed (possibly too many concurrent threads)".

(See Screenshot 1)

I got past this by including the cthreads unit as the first one among my uses. Then I can compile, but instead get problems when trying to run my compiled program:

Compiling and running the empty default project, gives something like this, in the terminal (typed from a screenshot, since running RDP):

Threading has been used before cthreads was initialized.
Make cthreads one of the first units in your uses clause.
Runtime error 211 at $002B45ED
  $002B45ED  _CARBONCALENDARVIEW_finalize, line 1078 of /Users/mattias/tmp/buildlaz/Root/Developer/lazarus/lcl/interfaces/carbon/carboncalendarview.pas
  $0002F036  PASCALMAIN, line 20 of ./include/headercontrol.inc
  $00010F5D of ./include/applicatoin.inc
  $00010E88 of ./include/wincontrol.inc
  $00000001


(See screenshot 2)

Any hints of things I could try? (Not sure I have access to all those LCL libs on this machine).
Title: Re: Missing cthreads on OS X Yosemite (Lazarus 1.4)
Post by: skalogryz on June 19, 2015, 09:37:00 pm
what's your project source code?
Title: Re: Missing cthreads on OS X Yosemite (Lazarus 1.4)
Post by: saml on June 19, 2015, 09:41:08 pm
what's your project source code?

I tried both with the default "application" project that is started when Lazarus start, and with my little tool project, of which sources are here: https://github.com/BILS/MDCFileExportTool

I get the same problem in both the Lazarus default application project, and my code above.
Title: Re: Missing cthreads on OS X Yosemite (Lazarus 1.4)
Post by: saml on June 19, 2015, 09:49:51 pm
I tried both with the default "application" project that is started when Lazarus start, and with my little tool project, of which sources are here: https://github.com/BILS/MDCFileExportTool

Just committed ifdefs with the cthreads use clause I've been using.
Title: Re: Missing cthreads on OS X Yosemite (Lazarus 1.4)
Post by: skalogryz on June 19, 2015, 10:07:08 pm
try to remove {$IFDEF UseCThreads} (http://forum.lazarus.freepascal.org/index.php?topic=6437.0) and see if it helps the problem.
Title: [SOLVED] Re: Missing cthreads on OS X Yosemite (Lazarus 1.4)
Post by: saml on June 19, 2015, 10:27:45 pm
try to remove {$IFDEF UseCThreads} (http://forum.lazarus.freepascal.org/index.php?topic=6437.0) and see if it helps the problem.

Yep, that did the trick! (Aaargh, didn't dawn upon me to check for uses clauses in the .lpr file!)

A BIG thanks for the quick reply and help! :)