Problem installing libpng on Intel Mac

Discussion in 'Mac Programming' started by gekko513, Jul 4, 2006.

  1. macrumors 603

    gekko513

    Joined:
    Oct 16, 2003
    #1
    My goal is to install the GD Graphics library, and to get png support I must install libpng. I thought Mac OS X already had libpng installed, but gd doesn't seem to agree, so I'm trying to install libpng from the source code.

    Libpng requires zlib, so I've downloaded, (./configure, make, make install) zlib-1.2.3. Seemed to work.

    Then I downloaded the source for libpng.1.2.12 and I'm trying to install it.

    The libpng install procedure doesn't follow "normal unix standard". I have to find my own makefile and put the already built zlib in a neighbour directory because it won't detect that zlib is installed in /usr/local/lib and /usr/local/include.

    Using the makefile.darwin to run "make test" I get the following error:
    Code:
    cc -dynamiclib \
     -install_name /usr/local/lib/libpng12.0.dylib \
     -current_version 0.1.2.12 -compatibility_version 0.1.2.12 \
     -o libpng12.0.1.2.12.dylib \
     png.pic.o pngset.pic.o pngget.pic.o pngrutil.pic.o pngtrans.pic.o pngwutil.pic.o pngread.pic.o pngrio.pic.o pngwio.pic.o pngwrite.pic.o pngrtran.pic.o pngwtran.pic.o pngmem.pic.o pngerror.pic.o pngpread.pic.o -L../zlib -lz
    ld: Undefined symbols:
    _png_mmx_support
    _png_combine_row
    _png_do_read_interlace
    _png_read_filter_row
    /usr/bin/libtool: internal link edit command failed
    make: *** [libpng12.0.1.2.12.dylib] Error 1
    
    Any thoughts? I've also tried the generic makefile.gcc without success.

    Strangely, /usr/local/include now holds four png related files (libpng libpng12 png.h pngconf.h); I don't know if they've always been there. I did a make install just for the heck of it, but it reported the same error.
     
  2. Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #2
    There are some step-by-step instructions here.

    I've not tried them mind...
     
  3. thread starter macrumors 603

    gekko513

    Joined:
    Oct 16, 2003
    #3
    Thanks, robbieduncan, but my problem remains unsolved.

    The following change had already been made in the newer version of the libpng source:
    ... and I did this, but I had already fixed that "problem" by putting zlib in a neighbour directory:
     
  4. macrumors 6502a

    #4
    Is there any reason for not installing it through fink?

    $apt-cache search gd2
    gd2 - Graphics generation library
    gd2-bin - Executables for gd2 package
    gd2-shlibs - Shared libraries for gd2 package
     
  5. macrumors 68030

    slooksterPSV

    Joined:
    Apr 17, 2004
    Location:
    Nowheresville
    #5
    Here's how I compile everything I need: --some packages 65% at least - come with a configure file and a config.sub file. Also some come with an autogen.sh that will do everything for you. Here's how to totally do it in terminal:

    cd /directory/to/the/libpng/extracted/folder
    sudo ./configure
    sudo make
    sudo make install

    If it says: cannot find such and such library, go get it.
     
  6. macrumors member

    rata911

    Joined:
    Jul 15, 2006
    Location:
    Uranus
    #6
    I got the same results (Intel MBP), playing around with the Makefile didn't produce any different results. Did you succeed in building libpng yet?
     
  7. thread starter macrumors 603

    gekko513

    Joined:
    Oct 16, 2003
    #7
    No, I gave up. I don't really need it. I was just going to experiment with a little something. Have you tried the fink version suggestion by AlmostThere?
     
  8. macrumors member

    rata911

    Joined:
    Jul 15, 2006
    Location:
    Uranus
    #8
    Uh, no.
    The PHP package that is released by the Entropy guys has built-in GD support so there MUST be some way of getting that bugger compiled. Maybe us two are just too dumb for that? :D
     
  9. macrumors member

    rata911

    Joined:
    Jul 15, 2006
    Location:
    Uranus
    #9
  10. thread starter macrumors 603

    gekko513

    Joined:
    Oct 16, 2003
    #10
    Thanks a lot! I wonder if that config file can somehow be ported to be used with the new version.
     
  11. macrumors member

    rata911

    Joined:
    Jul 15, 2006
    Location:
    Uranus
    #11
    Hm, interesting question. Maybe the makefile will work maybe not....who knows? :)
     
  12. j-b
    macrumors newbie

    Joined:
    Jul 27, 2006
    #12
    Are you still interested in a patch for libpng-1.2.12 on MacTel ?

    I think I got one.:)
     
  13. macrumors newbie

    Joined:
    Aug 4, 2006
    Location:
    Dallas, TX, USA
    #13
    Problem installing libpng on Intel Mac Reply to Thread

    j-b,

    Do you have any information on how to compile libpng on an Intel Mac? I've been searching and readling like crazy. I've seen many people with this problem. However, I haven't seen any answers.

    justbn
     
  14. thread starter macrumors 603

    gekko513

    Joined:
    Oct 16, 2003
    #14
    I have kind of moved on to different hunting grounds, but I'm sure the project that maintains libpng would appreciate and include the patch in their main trunk. That way we'd all benefit.
     
  15. macrumors newbie

    Joined:
    Aug 4, 2006
    Location:
    Dallas, TX, USA
    #15
    I've finally managed to resolve this. The issue I had is due to the fact I had downloaded the "no-configure" version of libpng. I don't think there is any way to get this version to work on an Intel Mac.

    From the libpng.org website, there is no link to the "coonfigurable" version. To access it, go to : http://prdownloads.sourceforge.net/libpng/libpng-1.2.12.tar.gz.

    Then simply :
    ./configure [--prefix=$HOME] (I used --prefix=/usr/local )
    make check
    make install

    It installs perfectly.
     
  16. j-b
    macrumors newbie

    Joined:
    Jul 27, 2006
    #16

Share This Page