Problems building universal binaries using -isysroot
Problems building universal binaries using -isysroot
- Subject: Problems building universal binaries using -isysroot
- From: Tron Thomas <email@hidden>
- Date: Thu, 13 Apr 2006 19:45:51 -0700
I am trying to convert a project that uses make files so that it can
build universal binaries for Mac OS X. The project relies on some 3rd
party software libraries. These libraries have been compiled so they
are universal binaries, and they work when building explicitly for the
native architecture of the system.
I have been able to get one the dynamic libraries for the project to
compile as a universal binary. In order to do this, I needed to include
the following when linking for the Intel platform:
-isysroot /Developer/SDKs/MacOSX10.4u.sdk
When I don't include this during linking I will get errors like the
following:
ld: Undefined symbols:
__Unwind_Resume
__ZNKSs5c_strEv
__ZNKSs7compareEPKc
__ZNSaIcEC1Ev
__ZNSaIcED1Ev
__ZNSsC1EPKcRKSaIcE
__ZNSsC1Ev
__ZNSsD1Ev
__ZNSsaSEPKc
__ZNSspLEPKc
__ZTVN10__cxxabiv117__class_type_infoE
__ZTVN10__cxxabiv121__vmi_class_type_infoE
___cxa_pure_virtual
___gxx_personality_v0
_fclose
_fopen
_fwrite
…
After getting the library to compile, I tried compiling a second library
that links to this first one. When I do this I encounter errors like
the following:
/usr/bin/ld: warning can't open dynamic library: /Developer/SDKs/
MacOSX10.4u.sdk/usr/local/lib/lib3rdparty.dylib referenced from:
libMyLibrary.dylib (checking for undefined symbols may be affected)
(No such file or directory, errno = 2)
…
/usr/bin/ld: Undefined symbols:
_some_method referenced from libMyLibrary expected to be defined in
/usr/local/lib/lib3rdparty.dylib
It seems pretty obvious that using -isysroot
/Developer/SDKs/MacOSX10.4u.sdk is causing this problem as the path to
the 3rd party library should just
be /usr/local/lib/lib3rdparty.dylib instead of
/Developer/SDKs/MacOSX10.4u.sdk/usr/local/lib/lib3rdparty.dylib. Yet if
I don't use this option, I will get undefined symbol errors like those
listed above.
How am I supposed to fix this problem?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden