Re: Random /usr/lib/libsqlite3.0.dylib Linking in Release Mode ONLY
Re: Random /usr/lib/libsqlite3.0.dylib Linking in Release Mode ONLY
- Subject: Re: Random /usr/lib/libsqlite3.0.dylib Linking in Release Mode ONLY
- From: Robert Sesek <email@hidden>
- Date: Tue, 8 Aug 2006 20:36:59 -0700
On Aug 8, 2006, at 05:27, Stuart A. Malone wrote:
On Aug 7, 2006, at 10:20 PM, Robert Sesek wrote: When I stick my static library (libsqlite3.a) in the Frameworks section, Xcode does the inexplicable and magically adds -lsqlite3 into the Ld phase. When I remove that file, though, that flag goes away from the transcript. I can't quite figure out why this is.
I noticed this item in the Xcode 2.4 release notes:
Better linking support
When linking against a framework or library, which is referenced via a project reference, Xcode will now properly track changes to and dependencies on the framework or library and re-link if it changes. Moreover, it will pass to the linker the full path to the referenced binary so that search paths are not necessary in order to link against it. In the event that you wish to use a search path to link against it, the recommended solution is to create a standalone reference to the file rather than using a reference which comes from a project reference.
So if your static library is being built in the same Xcode project as your applications, perhaps one solution would be to upgrade to Xcode 2.4 and make sure that you're using a project reference to refer to the static library.
Alternatively, you could probably add a Copy Files build step that copied the library to a different name, and then link with that. If your version of the library had a unique name, I don't see how Xcode could confuse it with the built-in version.
Thanks for the idea! It worked great. I simply renamed libsqlite3.a to libstaticsqlite3.a and Xcode gets it right. For some reason, adding a library into the framework section causes Xcode to do add a -l flag to LD. But renaming it fixes it and then it links against my search path and finds the right binary.
|
_______________________________________________
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