CFM vs Mach-O shared libs
CFM vs Mach-O shared libs
- Subject: CFM vs Mach-O shared libs
- From: Martin Hairer <email@hidden>
- Date: Mon, 13 Jun 2005 00:10:51 +0100
Hi, I am in the process of porting a bundle from CFM to Mach-O, which
uses
the OpenSource library libFLAC. For the CFM version, I used to
compile FLAC
as a CFM shared library, place it next to the executable within the
bundle and
everything worked fine.
I tried to do the same for the Mach-O version, but it doesn't seem to
work. When I try
to load my bundle, I get the error message "error code 4, error
number 0 (Library not
loaded: /usr/local/lib/libFLAC.7.dylib Referenced from: /Path/To/My/
bundle Reason:
image not found)". I do not want to force my users to install
anything into /usr/local/lib
so making an installer that would install libFLAC there is not an
option (although it works
fine when I do it). It seems that somewhere the access path to the
shared library is
hard-coded in my bundle. How can I tell XCode that the library loader
should look in
my bundle's executable folder for this library? I tried to call
setenv("DYLD_FALLBACK_LIBRARY_PATH", "/path/to/libFLAC", true);
before loading my bundle, but without success. I also tried to call
dlopen("/path/to/libFLAC", 0);
without more success... From what I understand, the problem is that
the "install name"
of the library is not the one I want (according to otool it is "/usr/
local/lib/libFLAC.7.dylib").
If this is indeed the case, is it possible to change this install
name without recompiling the
whole library? (The XCode project coming with the source code is
broken under 2.1
and I am not an expert in editing makefiles...) I tried to use
"libtool" to convert the static
version of the library into a shared library, but it complained about
all the symbols from
the standard C Runtime not being defined. If this is the way to go,
which options should I
pass to libtool so that it is happy? Thanks for any insight...
Martin
HairerSoft
http://www.hairersoft.com/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden