1

I was attempting to install XML::LibXSLT via CPAN, this seemed to work fine, until I attempted to load Google Chrome, or Microsoft Office. I am getting an error launching these programs with the following errors:

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

Obviously the problem is the new dylibs that XSLT installed, but these all seem to be X86_64 so I shouldn't be seeing any issues with this, I am running Mac OS X 10.6.8.

When running file /opt/local/lib/libxslt.dylib I get: /opt/local/lib/libxslt.dylib: Mach-O 64-bit dynamically linked shared library x86_64 as is the same with the libxslt.1.dylib.

Is there a way to solve this issue, and reinstate the original files that must have been replaced?

Edit: If were to get a copy of these Libraries from another Mac 10.6.8 64 bit and replace my apparantly confused ones with these, would this at least solve the issue of them being all mixed up.

Also running [/usr/lib]$ ls | grep libxslt gives me :

libxslt 2.dylib
libxslt-plugins
libxslt.1.dylib
libxslt.a
libxslt.dylib
libxslt.la
libxslt.pc
Matt C
  • 137
  • 1
  • 3
  • 15

2 Answers2

0

Did you install into or otherwise replace the original Apple-supplied libraries in /usr/lib? You should never do that. Otherwise, you'll likely break other parts of OS X that depend on those libraries. You should restore the original libraries from a backup or reinstall OS X. If you want newer versions, you should install them elsewhere, like in /usr/local/lib. Or better yet you should be using a third-party package manager, like Homebrew or MacPorts; in fact, you appear to be using MacPorts, judging from the /opt/local/lib path. Use that and don't alter system files in /usr (other than /usr/local) or /System/Library.

Ned Deily
  • 83,389
  • 16
  • 128
  • 151
  • I didn't manually alter any of them but I have a feeling CPAN did and just replaced the existing ones; rather than uninstalling them would just using another /usr/lib file and merging it in with mine work, if they are also on the exact same Mac version? – Matt C Jun 27 '13 at 15:16
  • The XML-LibXSLT distro does *not* install its own copy of libxslt, see [Makefile.PL](http://search.cpan.org/dist/XML-LibXSLT/Makefile.PL), and only provides the Perl bindings to the library. [Matt C](http://stackoverflow.com/u/1668803), if the system libraries have really been replaced, then you must have gotten it from somewhere else. – daxim Jun 27 '13 at 16:25
0

This may be relevant: How to compile universal binaries on Mac OS X.

I ran into this same issue where I had re-compiled libxslt and libxml to support python bindings, then started getting the /usr/lib/libxslt.1.dylib: mach-o, but wrong architecture error and an immediate crash when starting some apps (Specifically Synergy, which is a 32-bit/i386 app)

I solved this by recompiling libxml2 and libxslt using these configure options:

./configure CFLAGS="-arch i386 -arch x86_64" \ CXXFLAGS="-arch i386 -arch x86_64" \ LDFLAGS="-arch i386 -arch x86_64" \ --disable-dependency-tracking

Now libxml2 and libxslt libraries are properly showing as universal binaries:

$ file /usr/local/lib/libxslt.1.dylib /usr/local/lib/libxslt.1.dylib: Mach-O universal binary with 2 architectures
/usr/local/lib/libxslt.1.dylib (for architecture i386): Mach-O dynamically linked shared library i386
/usr/local/lib/libxslt.1.dylib (for architecture x86_64):   Mach-O 64-bit dynamically linked shared library x86_64

$ file /usr/local/lib/libxml2.2.dylib
/usr/local/lib/libxml2.2.dylib: Mach-O universal binary with 2 architectures
/usr/local/lib/libxml2.2.dylib (for architecture i386): Mach-O dynamically linked shared library i386
/usr/local/lib/libxml2.2.dylib (for architecture x86_64):   Mach-O 64-bit dynamically linked shared library x86_64
Community
  • 1
  • 1