Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 am trying to build ImageMagick 6.8.0-5 on OSX Lion with support for libpng. I am just using the standard ./configure make make install procedure.

I succeed in compiling when I do not reference libpng.

./configure --with-png=no

However, I get an error in make when I try to add libpng support. (libpng-1.5.13)

./configure --with-png=yes

The error seems to be a linker error.

/usr/bin/nm: no name list
ld: warning: cannot export hidden symbol _SyncImagePixelCache from magick/.libs/magick_libMagickCore_la-cache.o
ld: warning: cannot export hidden symbol _ResetQuantumState from magick/.libs/magick_libMagickCore_la-quantum.o
Undefined symbols for architecture x86_64:
  "_png_set_check_for_invalid_index", referenced from:
      _WriteOnePNGImage in magick_libMagickCore_la-png.o
      _ReadOnePNGImage in magick_libMagickCore_la-png.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status
make[1]: *** [magick/] Error 1
make: *** [all] Error 2

I have not changed any other options to configure.

How can I fix this to add libpng support?

share|improve this question
Running into this same issue. Did you ever figure it out? So far I've had to run without PNG support... – bmoeskau Jan 9 '13 at 18:21
haven't figured it out. my colleague also ran into it since then, but I think he fixed it just by using a pre-built binary from somewhere. I haven't had a chance to ask him but I'll try. – martin jakubik Jan 10 '13 at 9:14

You'll need to tell ImageMagick where to locate libpng. Luckily, libpng ships with a configuration script entitled "libpng-config".

You can get the link-library option form your local libpng install with the --L_opts flag.

libpng-config --L_opts

This will return something like -L/usr/local/lib. Set ImageMagick's LDFLAGS configuration to match your libpng library.

# Use the returned value for the LDFLAGS
./configure LDFLAGS='-L/usr/local/lib'

If libpng-config returns with a message 'command not found', you'll need to ensure your libpng is installed correctly, and can be located in your shell environment. Often, this can be as simple as adding a custom path to your PATH variable.

export PATH="$PATH:/usr/local/bin"
share|improve this answer

Had trouble getting ImageMagick to build correctly with png support on 10.10 myself, so I just used the installer from which includes png support. (installs in /opt)

share|improve this answer

Newer ImageMagick versions seems to rely on "pkg-config" to find your own libpng build. I just installed pkg-config and set PKG_CONFIG_LIBRARY=/path/to/my/libpng-version for it to work.

HTH, Axel.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.