在osx 10.9上编译phalcon时出现问题

时间:2014-08-02 14:14:36

标签: php macos phalcon

尝试遵循文档中的说明:

运行

$ sudo ./install

得到这个:

gcc -I. -I/Users/honky/cphalcon/build/64bits -DPHP_ATOM_INC -I/Users/honky/cphalcon/build/64bits/include -I/Users/honky/cphalcon/build/64bits/main -I/Users/honky/cphalcon/build/64bits -I/usr/local/php5/include/php -I/usr/local/php5/include/php/main -I/usr/local/php5/include/php/TSRM -I/usr/local/php5/include/php/Zend -I/usr/local/php5/include/php/ext -I/usr/local/php5/include/php/ext/date/lib -DPHALCON_RELEASE -DHAVE_CONFIG_H -O2 -finline-functions -fomit-frame-pointer -fvisibility=hidden -c /Users/honky/cphalcon/build/64bits/phalcon.c -fno-common -DPIC -o .libs/phalcon.o
/Users/honky/cphalcon/build/64bits/phalcon.c:108409:21: error: libintl.h: No such file or directory
/Users/honky/cphalcon/build/64bits/phalcon.c: In function ‘phalcon_translate_adapter_gettext_read_dimension’:
/Users/honky/cphalcon/build/64bits/phalcon.c:108425: warning: incompatible implicit declaration of built-in function ‘gettext’
/Users/honky/cphalcon/build/64bits/phalcon.c: In function ‘phalcon_translate_adapter_gettext_has_dimension’:
/Users/honky/cphalcon/build/64bits/phalcon.c:108441: warning: incompatible implicit declaration of built-in function ‘gettext’
/Users/honky/cphalcon/build/64bits/phalcon.c: In function ‘zim_Phalcon_Translate_Adapter_Gettext_query’:
/Users/honky/cphalcon/build/64bits/phalcon.c:108553: warning: incompatible implicit declaration of built-in function ‘gettext’
/Users/honky/cphalcon/build/64bits/phalcon.c:108555: warning: incompatible implicit declaration of built-in function ‘dgettext’
/Users/honky/cphalcon/build/64bits/phalcon.c: In function ‘zim_Phalcon_Translate_Adapter_Gettext_exists’:
/Users/honky/cphalcon/build/64bits/phalcon.c:108590: warning: incompatible implicit declaration of built-in function ‘gettext’
/Users/honky/cphalcon/build/64bits/phalcon.c:108592: warning: incompatible implicit declaration of built-in function ‘dgettext’
make: *** [phalcon.lo] Error 1

有什么猜测吗?

1 个答案:

答案 0 :(得分:3)

Mac OS x预装了PHP 5.x很长一段时间,但安装没有预先安装的扩展并解决库依赖性会占用大量的空闲时间,需要额外的努力,迷失在不相关的谷歌搜索结果中。我的经历告诉我,这很艰难。我强烈建议在Mac OS X上使用Homebrew来消除这种不必要的痛苦。

成功安装Homebrew后,拥有 Phalcon 扩展(以及数以千计的其他开源库/工具/应用程序)就像这样简单:

$ brew tap josegonzalez/homebrew-php
$ brew install php55-phalcon

当您需要其他扩展程序或库时,只需输入:

即可
$ brew search <whatever>

要了解有关公式或安装选项的更多信息,请执行以下操作:

$ brew info <whatever>

注意:自制软件需要安装Xcode。在冲泡之前,请确保Mac上已安装Xcode。如果出现问题,请使用brew doctor命令了解发生了什么。