php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #20463 gd error: free vs gd_free again
Submitted: 2002-11-17 09:41 UTC Modified: 2002-11-17 15:32 UTC
From: mcdaniew at ucsu dot colorado dot edu Assigned: derick (profile)
Status: Closed Package: Compile Failure
PHP Version: 4CVS-2002-11-17 OS: Redhat Linux 7.2
Private report: No CVE-ID: None
 [2002-11-17 09:41 UTC] mcdaniew at ucsu dot colorado dot edu
In file included from /home/wade/php4-200211171430/ext/gd/gd.c:89:
/home/wade/php4-200211171430/ext/gd/gd_ctx.c: In function `_php_image_output_ctx':
/home/wade/php4-200211171430/ext/gd/gd_ctx.c:73: structure has no member named `free'

Yes its this error again, and I do know that this error has been fixed in CVS. I even looked at the code and it should work, except #if HAVE_LIBGD204 isint being activated by the preprocessor. 

I have gd-2.0.7 installed.

How can I get the compiler to know I have a gd version greater than or equal to gd-2.0.4?

Heres my configure line
./configure 
--with-apxs2=/usr/local/apache2/bin/apxs 
--with-zlib 
--with-bz2 
--enable-calendar 
--with-gd=/usr/local/ 
--with-jpeg-dir=/usr/ 
--with-png-dir=/usr/ 
--with-tiff-dir=/usr/ 
--with-zlib-dir=/usr/ 
--with-gettext 
--with-imap 
--with-imap-ssl=/usr/local/ssl/ 
--enable-mime-magic 
--with-mysql=/usr/local/ 
--enable-sockets 
--with-pdflib 
--with-swf=/usr/local/ 
--with-kerberos

Thanks for the help, and for the great product!
-wade

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-11-17 09:53 UTC] derick@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.
 [2002-11-17 10:41 UTC] mcdaniew at ucsu dot colorado dot edu
Did you read the message?!

I have php4-200211171430 and #HAVE_LIBGD204 isint being set despite gd-2.0.7 being installed.

I have forced #HAVE_LIBGD204 1 in ext/gd/gd.c but configure isint setting it, and it seems to be compiling now but how stable will the build be?!

Thanks for the detailed help...
 [2002-11-17 10:53 UTC] derick@php.net
Please put your config.log online somewhere so that we can see why it went wrong.

Derick
 [2002-11-17 11:14 UTC] derick@php.net
In the posted config.log I see:

configure:30012: checking for gdFreeFontCache in -lgd
configure:30031: gcc -o conftest -g -O2   -L/usr/local//lib    -Wl,-rpath,/usr//lib -L/usr//lib -Wl,-rpath,/usr/local//lib -L/usr/local//lib conftest.c -lgd  -lgd -lpng -lz -ljpeg -lbz2 -lz -lcrypt -lresolv -lm -ldl -lnsl  -lcrypt 1>&5
/tmp/ccB9MDRB.o: In function `main':
/home/wade/php4-200211171430/configure:30027: undefined reference to `gdFreeFontCache'
collect2: ld returned 1 exit status
configure: failed program was:
#line 30020 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char gdFreeFontCache();

int main() {
gdFreeFontCache()
; return 0; }


That means that the requirement for GD 2.0.4 (or higher) is not met. I think you still have some old headers or libraries on your machine, and therefore the build script is picking up the wrong ones. Can you please check that?

Derick
 [2002-11-17 11:15 UTC] mcdaniew at ucsu dot colorado dot edu
My config.log is at http://ucsu.colorado.edu/~mcdaniew/config.log
 [2002-11-17 11:23 UTC] mcdaniew at ucsu dot colorado dot edu
Could this have something to do with freetype fonts?

My gd files pointed to by /usr/local all are fresh but gd had trouble compiling with the freetype fonts on my machine for some reason, so I built gd without freetype fonts. I tried to  build php without freetype fonts as well but that didnt seem to help anything.

If it doesnt detect the new version, yet still tries to compile with the new version then isint configure looking in the wrong place? There seems to be an incongruency there...

Thanks again!
-wade

bash> ls -l /usr/include/g*
-rw-r--r--    1 root     root         5129 Apr  2  2002 /usr/include/gconv.h
lrwxrwxrwx    1 root     root           11 Jul 28  2001 /usr/include/gdbm.h -> gdbm/gdbm.h
-rw-r--r--    1 root     root         6458 Apr  2  2002 /usr/include/getopt.h
-rw-r--r--    1 root     root        12963 Jan 10  2001 /usr/include/gif_lib.h
-rw-r--r--    1 root     root         7785 Apr  2  2002 /usr/include/glob.h
-rw-r--r--    1 root     root        38281 Feb  5  2001 /usr/include/gmp.h
-rw-r--r--    1 root     root         1075 Feb  5  2001 /usr/include/gmp-mparam.h
-rw-r--r--    1 root     root         2416 Apr  2  2002 /usr/include/gnu-versions.h
-rw-r--r--    1 root     root         8015 Apr  6  2001 /usr/include/gpm.h
-rw-r--r--    1 root     root         4879 Apr  2  2002 /usr/include/grp.h

bash> ls -l /usr/local/include/g*
-rw-r--r--    1 root     root         2722 Nov 16 20:39 /usr/local/include/gdcache.h
-rw-r--r--    1 root     root          490 Nov 16 20:39 /usr/local/include/gdfontg.h
-rw-r--r--    1 root     root          488 Nov 16 20:39 /usr/local/include/gdfontl.h
-rw-r--r--    1 root     root          451 Nov 16 20:39 /usr/local/include/gdfontmb.h
-rw-r--r--    1 root     root          452 Nov 16 20:39 /usr/local/include/gdfonts.h
-rw-r--r--    1 root     root          484 Nov 16 20:39 /usr/local/include/gdfontt.h
-rw-r--r--    1 root     root        20264 Nov 16 20:38 /usr/local/include/gd.h
-rw-r--r--    1 root     root          920 Nov 16 20:38 /usr/local/include/gd_io.h
 [2002-11-17 11:24 UTC] nicos@php.net
Yes it should be that, I tried to install CVS latest with gd 2.0.7 on both BSD and Linux boxes, it worked very fine. It looks you still have somewhere some old libraries or just headers. Just try to install gd somewhere else than the previouses versions and try again.

Regards.
 [2002-11-17 11:31 UTC] nicos@php.net
After some discuss, we think it's a bug. We work on it, thanks for your report.
 [2002-11-17 15:32 UTC] derick@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Dec 11 14:00:01 2025 UTC