Recent

Author Topic: [SOLVED] Missing cthreads on OS X Yosemite (Lazarus 1.4)  (Read 2796 times)

saml

  • New Member
  • *
  • Posts: 20
  • Developer, Biotech Engineer, PhD Student
    • Bionics IT
[SOLVED] Missing cthreads on OS X Yosemite (Lazarus 1.4)
« 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).
« Last Edit: June 19, 2015, 10:28:32 pm by saml »

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2289
    • havefunsoft.com
Re: Missing cthreads on OS X Yosemite (Lazarus 1.4)
« Reply #1 on: June 19, 2015, 09:37:00 pm »
what's your project source code?
Patron Cocoa Widgetset development https://www.patreon.com/skalogryz

saml

  • New Member
  • *
  • Posts: 20
  • Developer, Biotech Engineer, PhD Student
    • Bionics IT
Re: Missing cthreads on OS X Yosemite (Lazarus 1.4)
« Reply #2 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.
« Last Edit: June 19, 2015, 09:48:59 pm by saml »

saml

  • New Member
  • *
  • Posts: 20
  • Developer, Biotech Engineer, PhD Student
    • Bionics IT
Re: Missing cthreads on OS X Yosemite (Lazarus 1.4)
« Reply #3 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.

skalogryz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2289
    • havefunsoft.com
Re: Missing cthreads on OS X Yosemite (Lazarus 1.4)
« Reply #4 on: June 19, 2015, 10:07:08 pm »
try to remove {$IFDEF UseCThreads} and see if it helps the problem.
Patron Cocoa Widgetset development https://www.patreon.com/skalogryz

saml

  • New Member
  • *
  • Posts: 20
  • Developer, Biotech Engineer, PhD Student
    • Bionics IT
[SOLVED] Re: Missing cthreads on OS X Yosemite (Lazarus 1.4)
« Reply #5 on: June 19, 2015, 10:27:45 pm »
try to remove {$IFDEF UseCThreads} 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! :)