PHP make失败,错误为:未定义符号\u XpmLibraryVersion

PHP make失败,错误为:未定义符号\u XpmLibraryVersion,php,compiler-errors,gd,osx-mavericks,Php,Compiler Errors,Gd,Osx Mavericks,我正试图自己在MacOSX小牛上编译PHP 以下是configure命令: ./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/l

我正试图自己在MacOSX小牛上编译PHP

以下是configure命令:

./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
当我尝试d
sudo make
时,我得到以下错误:

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版本为5.5.5libgd是使用此配置编译的:

./configure --prefix=/opt/local --with-png=/opt/local --with-jpeg=/opt/local 
--with-tiff=/opt/local --with-freetype=/opt/local
如果没有
--with gd
标志,PHP编译就可以了


这个错误是什么意思?我该如何修复它?

您可以通过--with xpm dir=no来配置应该禁用xpm支持的选项,如果这不能解决问题,请尝试安装for Mac OS X。并且,您可能应该在安装更新后重新编译(包括libXpm)

这个选项在Debian上对我有帮助:

--with-gd=/usr/ --with-xpm-dir=/usr/ '--with-libdir=lib/x86_64-linux-gnu'

谢谢回复!我尝试了两种选择,但都没用,还是一样的问题。有趣。在安装X11(包括libXpm)之后,您可以尝试重新编译libgd,但在其他方面我感到困惑。最后!你就是那个人!问题解决了。我爱你,我花了几乎半天的时间来解决这个问题,我不认为我可以直接使用XQuartz的libXpm。所以我用xpm重新编译了GD,用xpm重新编译了php。谢谢