Can't get an application built on OS X 10.9 to run on OS X 10.5

Problem

I recently upgraded my build environment to Xcode 6.1.1 while working on OS X 10.9 and now I am unable to start my application again under OS X Leopard, 10.5.

The base SDK target is set to OS X 10.6 and the OS X deployment target is set to OS X 10.5 . Checking the build logs shows that these settings are making their way to the compilation and linking steps (in form mmacosx-version-min=10.5

, export MACOSX_DEPLOYMENT_TARGET=10.5

etc.)

However, when I run the application under OS X 10.5, it immediately resets with the error:

Dyld Error Message:
  Symbol not found:    __ZNSt15basic_stringbufIcSt11char_traitsIcESaIcEE9showmanycEv
  Referenced from: /[path]/[Application Name].app/Contents/MacOS/[Application Name]
  Expected in: /usr/lib/libstdc++.6.dylib

      

What I have tried so far

A little digging reveals that on OS X 10.9 /usr/lib/libstdc++.6.dylib

there is a link to version 6.0.9 and on OS X 10.5 it is a link to version 6.0.4.

Other questions on SO suggest that the answer should include a copy of the required libstdc ++ version. 6.dylib in the app bundle and point the dynamic linker to it using install_name_tool

.

So, I ran the command:

install_name_tool -change /usr/lib/libstdc++.6.dylib @executable_path/libstdc++.6.dylib [Application Name].app/Contents/MacOS/[Application Name]

      

And otool -L [Application Name].app/Contents/MacOS/[Application Name]

now reports:

@executable_path/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.9.0)

      

I copy /usr/lib/libstdc++.6.0.9.dylib

to location [Application Name].app/Contents/MacOS/libstdc++.6.dylib

and copy the application to the deployment machine and I get ...

Dyld Error Message:
  Symbol not found:    __ZNSt15basic_stringbufIcSt11char_traitsIcESaIcEE9showmanycEv
  Referenced from: /[path]/[Application Name].app/Contents/MacOS/[Application Name]
  Expected in: /usr/lib/libstdc++.6.dylib

      

... the exact same error message.

Running otool -L

in the application on the deployment machine confirms that the link to libstdc++.6.dylib

still points to the path in @executable_path

which I installed with install_name_tool

.

So why is the dynamic linker ignoring the path set to install_name_tool

and still looking in /usr/lib

?

Is this the correct solution to the problem?

+3


source to share





All Articles