#29266 closed defect (fixed)
gd2: libgd.dylib doesn't contain symbols _gdImageCreateFromPng _gdImagePng
Reported by: | jonasjonas (Frank Hellenkamp) | Owned by: | ryandesign (Ryan Carsten Schmidt) |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | 1.9.2 |
Keywords: | Cc: | ||
Port: | gd2 |
Description (last modified by ryandesign (Ryan Carsten Schmidt))
graphviz (and graphviz-devel) are failing to build/link, both with the follwoing error message:
:info:build Undefined symbols for architecture x86_64: :info:build "_gdImageCreateFromPng", referenced from: :info:build _imageLoad in diffimg.o :info:build "_gdImagePng", referenced from: :info:build _main in diffimg.o
After cleaning the port, I already tried rebuilding some dependencies of graphviz like
- libpng
- gd2
- gts
- ghostscript
but it doesn't help.
Attachments (4)
Change History (15)
Changed 14 years ago by jonasjonas (Frank Hellenkamp)
Changed 14 years ago by jonasjonas (Frank Hellenkamp)
Attachment: | main.2.log added |
---|
build log of graphviz-devel
Changed 14 years ago by jonasjonas (Frank Hellenkamp)
Attachment: | macports.conf added |
---|
my macports.conf
comment:1 Changed 14 years ago by jonasjonas (Frank Hellenkamp)
I forgot: I am on Snow Leopard 10.6.7 and have the xcode 4.0.2 Build 4A2002a installed.
comment:2 Changed 14 years ago by ryandesign (Ryan Carsten Schmidt)
Description: | modified (diff) |
---|
comment:3 follow-up: 4 Changed 14 years ago by ryandesign (Ryan Carsten Schmidt)
Owner: | changed from macports-tickets@… to ryandesign@… |
---|---|
Port: | graphviz-devel added |
Summary: | graphviz (and graphiz-devel) fails to build → graphviz, graphiz-devel: Undefined symbols _gdImageCreateFromPng _gdImagePng |
This problem is new to me. Graphviz always builds fine for me on Tiger, Leopard or Snow Leopard. But I have not used Xcode 4 yet.
I wonder if gd2 built properly. What do these commands output?
nm /opt/local/lib/libgd.dylib | grep gdImageCreateFromPng nm /opt/local/lib/libgd.dylib | grep gdImagePng
comment:4 Changed 14 years ago by jonasjonas (Frank Hellenkamp)
gd has been build with the no_x11 variant, but I had the same problem before without any variants.
I get these results:
jonas@metultelet ~ $ nm /opt/local/lib/libgd.dylib | grep gdImageCreateFromPng 000000000000dd50 T _gdImageCreateFromPngSource jonas@metultelet ~ $ nm /opt/local/lib/libgd.dylib | grep gdImagePng 000000000000dd80 T _gdImagePngToSink jonas@metultelet ~ $
comment:5 Changed 14 years ago by ryandesign (Ryan Carsten Schmidt)
Port: | gd2 added; graphviz graphviz-devel removed |
---|---|
Summary: | graphviz, graphiz-devel: Undefined symbols _gdImageCreateFromPng _gdImagePng → gd2: libgd.dylib doesn't contain symbols _gdImageCreateFromPng _gdImagePng |
Ok, that seems to confirm that several png-related functions are missing from gd2, which explains why graphviz can't find them. They are present in my gd2, regardless whether I use the no_x11 variant or not.
Can you please build gd2 again, without the no_x11 or universal variants, and without parallel building:
sudo port clean gd2 sudo port destroot gd2 -no_x11 -universal build.jobs=1 cp /opt/local/var/macports/logs/*_gd2/main.log ~/Desktop/ sudo port -n upgrade --force gd2 -no_x11 -universal
Then attach the main.log, which is now on your Desktop, to this ticket, and I'll compare it with mine.
Changed 14 years ago by jonasjonas (Frank Hellenkamp)
Attachment: | main.3.log added |
---|
build log for gd2
comment:6 Changed 14 years ago by jonasjonas (Frank Hellenkamp)
I attached the build log for gd2 for comparison.
The problem seems to remain (missing symbols).
comment:7 Changed 14 years ago by ryandesign (Ryan Carsten Schmidt)
Resolution: | → fixed |
---|---|
Status: | new → closed |
The suspicious line in your log is:
:info:configure checking for libpng12-config... /usr/bin/libpng12-config
That file is not a part of any version of Mac OS X that I've used up to and including Snow Leopard, so I'm surprised you have that file.
I have patched gd2 in r78153 to no longer look for a libpng12-config, since MacPorts libpng is now at version 1.4.x which doesn't have a libpng12-config. This should allow you to install gd2 properly, and then build graphviz properly.
But nothing other than Mac OS X should be installing things in prefix /usr, so I recommend you remove /usr/bin/libpng12-config and any other parts of libpng in /usr/bin, /usr/include, /usr/lib, etc. They are not supposed to be there.
comment:8 Changed 14 years ago by ryandesign (Ryan Carsten Schmidt)
I increased gd2's revision in r78154 so you should only have to wait an hour or so, then "sudo port selfupdate" and "sudo port upgrade gd2" to get the fix.
comment:9 follow-up: 11 Changed 14 years ago by jonasjonas (Frank Hellenkamp)
Interesting - a search on my system for libpng12 returns the following files + a lot of symbolic links which i did not list:
/Developer/SDKs/MacOSX10.6.sdk/usr/X11/lib/libpng12.0.dylib /Developer/SDKs/MacOSX10.6.sdk/usr/X11/include/libpng12 /usr/X11/include/libpng12 /usr/X11/lib/pkgconfig/libpng12.pc /usr/X11/lib/libpng12.0.dylib /usr/X11/bin/libpng12-config /usr/lib/libpng12.a /usr/lib/libpng12.0.1.2.8.dylib /usr/bin/libpng12-config
So it seems to be part of the Developer Tools/SDK.
I will rename the "/usr/bin/libpng12-config" for testing - but if libpng12 is part of the official SDK we would have to find another workaround.
Thanks alot for your help!
comment:10 Changed 14 years ago by jonasjonas (Frank Hellenkamp)
Sorry, I missed the second message so forget the workaround part in my last message... ;-)
The new build was successful.
Thanks again!
comment:11 Changed 14 years ago by ryandesign (Ryan Carsten Schmidt)
Replying to jonas@…:
I will rename the "/usr/bin/libpng12-config" for testing - but if libpng12 is part of the official SDK we would have to find another workaround.
libpng files in prefix /usr/X11 (/usr/X11/bin, /usr/X11/include, /usr/X11/lib), and in prefix /Developer/SDKs/*/usr/X11, are part of Mac OS X, should stay where they are, and are not the issue here. The issue is libpng files in prefix /usr (/usr/bin, /usr/include, /usr/lib), which are not a part of Mac OS X and should not be there.
build log of graphviz