Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I was stupid enough to compile sqlite3 from source and install it to /usr, overriding default library.
This being done, Google Chrome doesn't launch anymore, crashing with this output:

Dyld Error Message:
  Library not loaded: /usr/lib/libsqlite3.dylib
  Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Security
  Reason: no suitable image found.  Did find:
    /usr/lib/libsqlite3.dylib: mach-o, but wrong architecture
    /usr/local/lib/libsqlite3.dylib: mach-o, but wrong architecture
    /usr/lib/libsqlite3.dylib: mach-o, but wrong architecture

Can I somehow revert sqlite3 to the original version I had, or fix the issue somehow else?

share|improve this question
up vote 3 down vote accepted

I was able to fix that by compiling sqlite3 for i386 and x86_64 and placing it in /usr:

./configure --prefix=/usr --disable-dependency-tracking CFLAGS="-arch i386 -arch x86_64"
share|improve this answer

On my system, libsqlite3.dylib was installed as part of the BaseSystem package, and updated by the 10.6.5 and 10.6.7 packages.

$ grep -rl libsqlite3.dylib /var/db/receipts/

You can extract just those files from the original .pkg files using something like Pacifist, pkgutil or installer. It wasn't immediately obvious to me how to extract a single file from a .pkg file with the command line tools. It's pretty straightforward with Pacifist; docs are here.

share|improve this answer

If you changed soemthing in /usr you have changed code provided by Apple so you will have to reinstall the OS. However as this is a large chnage I would try first restoring mysql from your backup :). If not then get the combo OSX verstion update from Apple. Otherwise go to the OSX DVD you can restore a few files by looking at the package contents - however my OSX is messed up and and don't have the correct package name.

For this particular case you could recompile as @gaearon says but you have to get the correct version and assume Apple have done no changes.

In general I would add new libraries using a package manager fink, macports etc. as they place things outside Apple system areas and deal with any oddities of OSX. If you compile your own use /usr/local

share|improve this answer
It's a standard library so there is no point for Apple to make changes to it. It's used by a lot of non-system applications, e.g. Chrome and Firefox. The problem was not in version, rather in that I compiled it only for x86_64 arch, whereas it should've been compiled both for i386 and x86_64, or else half the applications stops working. Luckily, all apps work well enough with the new version—and next time I'll install my stuff in /usr/local. Thanks for your note! – Dan Mar 1 '11 at 13:39
I agree in this case but Apple can make changes to Open Source software e.g. to use their Frameworks and then having side effects. – Mark Mar 1 '11 at 13:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .