|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2009-03-27 19:16 UTC] oeriksson at mandriva dot com
Description: ------------ I get an unresolved symbol when linking against system libgd. Reproduce code: --------------- Just running php-cli Expected result: ---------------- Should work. Actual result: -------------- PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/extensions/gd.so' - /usr/lib64/php/extensions/gd.so: undefined symbol: gdJpegGetVersionInt in Unknown on line 0 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 07:00:01 2025 UTC |
I described it in "Description:" :-) Here's a proposed fix: --- ext/gd/gd.c 2009-01-31 16:27:52.000000000 +0100 +++ ext/gd/gd.c.oden 2009-03-27 20:27:14.000000000 +0100 @@ -55,6 +55,15 @@ #if HAVE_LIBGD +#ifdef HAVE_GD_PNG +/* needs to be first */ +# include <png.h> +#endif + +#ifdef HAVE_GD_JPG +# include <jpeglib.h> +#endif + static int le_gd, le_gd_font; #if HAVE_LIBT1 #include <t1lib.h> @@ -1293,8 +1302,13 @@ PHP_MINFO_FUNCTION(gd) #endif #ifdef HAVE_GD_JPG { +#if HAVE_GD_BUNDLED char tmp[12]; snprintf(tmp, sizeof(tmp), "%d", gdJpegGetVersionInt()); +#else + char tmp[256]; + snprintf(tmp, sizeof(tmp), "%d", JPEG_LIB_VERSION); +#endif php_info_print_table_row(2, "JPG Support", "enabled"); php_info_print_table_row(2, "libJPEG Version", tmp); } @@ -1302,7 +1316,11 @@ PHP_MINFO_FUNCTION(gd) #ifdef HAVE_GD_PNG php_info_print_table_row(2, "PNG Support", "enabled"); +#if HAVE_GD_BUNDLED php_info_print_table_row(2, "libPNG Version", gdPngGetVersionString()); +#else + php_info_print_table_row(2, "libPNG Version", PNG_LIBPNG_VER_STRING); +#endif #endif #ifdef HAVE_GD_WBMP php_info_print_table_row(2, "WBMP Support", "enabled");