Search code examples
phpcompiler-errorsgdosx-mavericks

PHP make fails with error: Undefined symbols _XpmLibraryVersion


I am trying to compile PHP myself on Mac OS X Mavericks.

Here is the configure command:

./configure --prefix=/opt/local/php --with-config-file-path=/opt/local/php/conf 
--with-apxs2=/opt/local/apache/bin/apxs --with-mysql=/opt/local/mysql 
--with-mysql-sock=/tmp --with-libedit --with-pcre-dir=/opt/local 
--enable-bcmath --enable-mbstring --enable-sockets --enable-zip --with-bz2 
--with-curl --with-jpeg-dir=/opt/local --with-png-dir=/opt/local 
--with-freetype-dir=/opt/local --with-gd=/opt/local

When I try to d sudo make, I get this error:

Undefined symbols for architecture x86_64:
 "_XpmLibraryVersion", referenced from:
   _zm_info_gd in gd.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

PHP version is 5.5.5 and libgd was compiled with this config:

./configure --prefix=/opt/local --with-png=/opt/local --with-jpeg=/opt/local 
--with-tiff=/opt/local --with-freetype=/opt/local

Without the --with-gd flag, PHP compiles just fine.

What does this error mean and how do I fix it?


Solution

  • You can pass --with-xpm-dir=no to configure which should disable xpm support, if that doesn't resolve it try installing the X11 Update for Mac OS X. And, you should probably recompile libgd after installing that update (to include libXpm)