Re: Linking with static sqlite 3 library
Re: Linking with static sqlite 3 library
- Subject: Re: Linking with static sqlite 3 library
- From: Chris Espinosa <email@hidden>
- Date: Thu, 9 Jun 2005 01:57:11 -0700
On Jun 9, 2005, at 1:19 AM, Eric Albert wrote: So my question is, how can I force my project to link to my static sqlite3 library instead of the shared one?
We just saw this yesterday. Turns out that the linker prefers to use a .dylib over a .a when you have both.
So you need to do the following: - remove the sqlite3.a library from your project - add an explicit flag in Other Linker flags that reads something like "-l/usr/local/lib/sqlite/libsqlite3.dylib" (replace with the appropriate fully-qualified path to your lib)
There's potentially a second option here: Pass the -search_paths_first argument to ld and ensure that the path to your static library is passed to ld before the path to the system's dylib. See the ld man page for details on -search_paths_first.
That works to resolve your libsqlite3.a from the system's libsqlite3.dylib, but if you have both in your local directory, ld will always prefer the first, when given a plain "-lsqlite3" flag. So you have to pass the fully qualified one, but in this case, only if you have both in the same directory.
Chris |
_______________________________________________
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