* * *

Author Topic: ProjectXC  (Read 293 times)

Frank

  • New member
  • *
  • Posts: 46
ProjectXC
« on: January 02, 2018, 10:43:55 pm »
Hi All,
I have 2 Delphi 10.2 projects I am converting to Freepascal. Both have made the trip from FMX -> VCL -> LCL & compile/run on macOS 10.12.6 (32bit/carbon). To make signing them easier I have used ProjectXC to re-compile them. One works great... The other which uses the "Printers" unit, Xcode fails while running the FPC script.

The Error (in part)  :
   "Undefined symbols for architecture i386:", "
   "_PMPaperGetName", referenced from:
      _OSPRINTERS$_$TCARBONPRINTER_$__$$_BEGINENUMPAPERS$TSTRINGS in osprinters.o"
  "ld: symbol(s) not found for architecture i386"

Lazarus IDE (svn 1.9) gives no such error...

What am I missing? Any ideas?
Frank 

Phil

  • Hero Member
  • *****
  • Posts: 2379
Re: ProjectXC
« Reply #1 on: January 02, 2018, 11:17:56 pm »
The Error (in part)  :
   "Undefined symbols for architecture i386:", "
   "_PMPaperGetName", referenced from:
      _OSPRINTERS$_$TCARBONPRINTER_$__$$_BEGINENUMPAPERS$TSTRINGS in osprinters.o"
  "ld: symbol(s) not found for architecture i386"

This is a rather obscure bug in Lazarus. _PMPaperGetName and _PMSetResolution are deprecated in 10.10 but are used by Lazarus Carbon and Cocoa widgetset code (osprinter.pp). Try setting the Deployment Target to 10.9 instead of 10.10 or higher in Xcode. This will "unhide" those deprecated symbols. I believe Lazarus sets the target to 10.4 or something (bad idea, in my opinion) so you don't see the problem in the Laz IDE.

In general, I would never target less than 10.10, but for testing a Laz app in Xcode you'll have to reduce the target to work around this bug. (Note that according to netmarketshare.com, about 95% of Mac users are on 10.10 or later - and I would guess that the remaining 5% are probably too lazy to upgrade, meaning you probably don't want them.)

Frank

  • New member
  • *
  • Posts: 46
Re: ProjectXC
« Reply #2 on: January 02, 2018, 11:33:58 pm »
@Phil : Brilliant !
           
I wouldn't have discovered that in years...
Resetting to 10.6 (lowest my Xcode would allow) allowed it to compile it & run.

Now to find a way to reset to 10.10...

Thank you Phil

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus