1
General discussions / Linking problem, Mac 10.5.8 SFML 1.6
« on: June 23, 2010, 10:25:27 pm »
Ahh. Thank you.
That is a tool (install_name_tool) that I had never seen mentioned before, nor the idea that a library/framework includes a "Where to find me" separate from its actual location.
As for the "Frameworks" section of a bundle, I thought that magic was done by the dynamic linker, and not by hardcoding a "relative" pathname in anything.
====
There is a option to ld that actually does what I want:
This is what I thought was default behavior, but has to be specified.
I would not have found this without your hint about install_name_tool
---
So I think my final solution will be to put it into /Library, and leave /opt to MacPorts.
That is a tool (install_name_tool) that I had never seen mentioned before, nor the idea that a library/framework includes a "Where to find me" separate from its actual location.
As for the "Frameworks" section of a bundle, I thought that magic was done by the dynamic linker, and not by hardcoding a "relative" pathname in anything.
====
There is a option to ld that actually does what I want:
Code: [Select]
-dylib_file install_name:file_name
Specifies that a dynamic shared library is in a different
location than its standard location. Use this option when you
link with a library that is dependent on a dynamic library,
and the dynamic library is in a location other than its
default location. install_name specifies the path where the
library normally resides. file_name specifies the path of the
library you want to use instead. For example, if you link to
a library that depends upon the dynamic library libsys and
you have libsys installed in a nondefault location, you would
use this option: -dylib_file /lib/lib-
sys_s.A.dylib:/me/lib/libsys_s.A.dylib.
This is what I thought was default behavior, but has to be specified.
I would not have found this without your hint about install_name_tool
---
So I think my final solution will be to put it into /Library, and leave /opt to MacPorts.