Compile for 10.5 OSX lazarus / 15-macOS - Mac OS X ---------------------------------------------------------------------- JimKueneman · 2012-08-06 07:13 I am running the latest 1.0 RC1 on Lion.  I created an app that a 10.5 user says crashes on startup.  I have run it on 10.7 and 10.6 with no issues.  There are a bunch of warning that occur during the compile that get overwritten that say something about an assumed min version of OSX but it goes by to fast to read.  How do I set the compiler up to ensure 10.5 compatibility?  Thanks, Jim ---------------------------------------------------------------------- Jonas Maebe · 2012-08-06 08:42 Quote from: JimKueneman on August 06, 2012, 09:13:09 amI am running the latest 1.0 RC1 on Lion.  I created an app that a 10.5 user says crashes on startup.  I have run it on 10.7 and 10.6 with no issues.  There are a bunch of warning that occur during the compile that get overwritten that say something about an assumed min version of OSX but it goes by to fast to read.  How do I set the compiler up to ensure 10.5 compatibility?  I don't think that Xcode on Lion still officially supports targeting 10.5. It definitely no longer ships with the Mac OS X 10.5 SDK. What you can try, is to add the following parameters to the compiler: Code: [Select]-k-macosx_version_min -k10.5 This will instruct the linker to generate a binary that can be started on Mac OS X 10.5. Without also linking to the 10.5 SDK (which is only officially supported on Mac OS X 10.6 and earlier -- yes, Apple is making it harder and harder to properly support older Mac OS X versions if you run a newer one yourself), it's still possible that the program will nevertheless fail to start because of newer library versions or symbols that are in different frameworks on 10.7 compared to 10.5. ---------------------------------------------------------------------- jwdietrich · 2012-08-06 08:46 Please see http://wiki.lazarus.freepascal.org/OS_X_Programming_Tips#De ploying_an_executable.2C_Compiling_under_10.6_for_10.5_and_above for details. ---------------------------------------------------------------------- JimKueneman · 2012-08-06 13:48 Thanks, so I am doing 2 things right now: 1) Downloading the XCode 3.2 for Snow Leopard to install the 10.5 SDK per this: http://stackoverflow.com/questions/5378518/how-to-add-base-sdk- for-10-5-in-xcode-4 2) Trying to use the Conditionals here as directed:     http://wiki.lazarus.freepascal.org/OS_X_Programming_Tips#Deploying _an_executable.2C_Compiling_under_10.6_for_10.5_and_above QuoteAdding the custom options only when compiling for OS X To add the above custom options only when compiling for OS X add to Project / Compiler options / IDE macros / Conditionals: if TargetOS = 'darwin' then begin   UsageCustomOptions += ' -k-macosx_version_min -k10.5';  // UsageCustomOptions += ' -XR/Developer/SDKs/MacOSX10.5.sdk/'; Not valid yet..... downloading the beast end; When I do this I expected the first switch to be added to the command line parameters when I press the "Show Options" button in the Project Option dialog.  Is there something I need to to to "enable" UsageCustomOption"? Sorry I am on the front edge of the Lazarus/FPC/OSX learning curve. Thanks, Jim ---------------------------------------------------------------------- JimKueneman · 2012-08-07 02:47 Found another post with the same problem.  The webpage way does not work.  Project > Options > Other > Custom Option and add this: -k-macosx_version_min -k10.5 -XR/Developer/SDKs/MacOSX10.5.sdk/ Download the older version of Xcode mount the drive, look for MacOSX10.5.dmg in one of the folders and run it to install to a folder.  I am still waiting for my tester to verify it works but it did compile... Update:  Success it now runs on Tiger! Jim ---------------------------------------------------------------------- Phil · 2012-08-07 13:40 Quote from: JimKueneman on August 07, 2012, 04:47:30 am Update:  Success it now runs on Tiger! Note Tiger is 10.4, not 10.5. ---------------------------------------------------------------------- JimKueneman · 2012-08-07 23:15 Thanks, I am being told it is Tiger but the compile for 10.5 allows it to run so maybe it is Leopard.  Who knowns maybe it is Kitten but is works.  Jim ---------------------------------------------------------------------- jwdietrich · 2012-08-08 00:49 10.5 is Leopard. For Tiger (10.4) you would use Code: [Select]-k-macosx_version_min -k10.4 -XR/Developer/SDKs/MacOSX10.4u.sdk/ but this will not work with any version of Xcode.