1. 程式人生 > >brew yaf error: unknown type name ‘HASHKIT_API‘

brew yaf error: unknown type name ‘HASHKIT_API‘

yaf HASHKIT_API

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);

#================================================================
*/

brew yaf error: unknown type name ‘HASHKIT_API‘