1.在 mac 系统中安装 PHP yaf 扩展时,总是失败;报错:error: unknown type name ‘HASHKIT_API‘
\h:\W \u$ brew install php70-yaf
==> Installing php70-yaf from homebrew/php
==> Downloading https://github.com/laruence/yaf/archive/yaf-3.0.3.tar.gz
Already downloaded: /Users/liuqh/Library/Caches/Homebrew/php70-yaf-3.0.3.tar.gz
==> /usr/local/opt/php70/bin/phpize
==> ./configure --prefix=/usr/local/Cellar/php70-yaf/3.0.3 --with-php-config=/usr/local/opt/php70/bin/php-config
==> make
Last 15 lines from /Users/liuqh/Library/Logs/Homebrew/php70-yaf/03.make:
/usr/local/include/string.h:56:1: error: unknown type name ‘HASHKIT_API‘
HASHKIT_API
^
/usr/local/include/string.h:57:1: error: expected identifier or ‘(‘
const char *hashkit_string_c_str(const hashkit_string_st* self);
^
6 errors generated.
make: *** [yaf_bootstrap.lo] Error 1
make: *** Waiting for unfinished jobs....
6 errors generated.
make: *** [yaf.lo] Error 1
6 errors generated.
make: *** [yaf_application.lo] Error 1
6 errors generated.
make: *** [yaf_dispatcher.lo] Error 1
====> 解决方法:
找到/usr/local/include/string.h 注释调和‘HASHKIT_API有关的代码;
/*=============================20180314 解决yaf 装不上的问题,注释
#HASHKIT_API
void hashkit_string_free(hashkit_string_st *ptr);
#HASHKIT_API
size_t hashkit_string_length(const hashkit_string_st *self);
#HASHKIT_API
const char *hashkit_string_c_str(const hashkit_string_st* self);
#================================================================
*/
原文地址:http://blog.51cto.com/liuqh/2086868
时间: 2024-10-14 12:41:12