Posts Tagged macports

Macports can’t find zlib.dylib – my solution

Untitled

As some of you know I recently upgraded my mac to Snow Leopard (10.6). Since I do not believe in “Upgrade installations” this meant having to reinstall all my software after formatting the drive and installing OS X. Being a Unix-poweruser one of the first thing I installed was Macports to give me easy access to Apache, Mysql, PHP and other software. Using macports I also tried to install freetype to go with my newly installed copy of Wine. But then the fun stopped – it failed!

Error: Target org.macports.extract returned: lipo: can't open input file: /opt/local/lib/libz.dylib (No such file or directory)

For some reason the auto-installed (by dependencies) zlib did not install zlib.dylib. I tried to reinstall zlib using port but without luck.

But I did find an another solution to the problem. It turns out that zlib compiles just fine under Snow Leopard without ports! My solution – the short version: Download and install zlib separately and then copy it to /opt/local/lib.

My solution – the almost too short version:

cd /usr/local/src
wget http://www.zlib.net/zlib-1.2.3.tar.gz
tar xvzf zlib-1.2.3.tar.gz
cd zlib-1.2.3
./configure --shared
make
sudo make install
cp /usr/local/lib/zlib* /opt/local/lib/

Done! Replace /usr/local/src with a directory of your liking…

It might not be the best, or the only, solution to the problem but it worked for me. Since I guess that this post might help others I wrote it in English.

, , ,

4 Comments