php - 在此范围内未声明“UnicodeString”

标签 php ubuntu pecl icu intl

我无法编译php-intl(php - 5.5.9、ubuntu - 14.04、icu - 67)

当我尝试pecl install intl时,出现以下错误

In file included from /tmp/pear/temp/intl/intl_convertcpp.cpp:21:0:
/tmp/pear/temp/intl/intl_convertcpp.h:28:25: error: 'UnicodeString' was not declared in this scope
 int intl_stringFromChar(UnicodeString &ret, char *str, int32_t str_len, UErrorCode *status);
                         ^~~~~~~~~~~~~
/tmp/pear/temp/intl/intl_convertcpp.h:28:25: note: suggested alternative:
In file included from /tmp/pear/temp/intl/intl_convertcpp.h:26:0,
                 from /tmp/pear/temp/intl/intl_convertcpp.cpp:21:
/opt/icu67/include/unicode/unistr.h:294:20: note:   'icu_67::UnicodeString'
 class U_COMMON_API UnicodeString : public Replaceable
                    ^~~~~~~~~~~~~

请告诉我如何克服这个错误

或者其他更新 icu 数据库的方法,因为 apt-get 放置了一个非常旧的数据库。

最佳答案

使用 icu_67::UnicodeString 而不是 UnicodeString,您的问题就得到解决。

关于php - 在此范围内未声明“UnicodeString”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61910551/

相关文章:

php - 在 MAMP 上安装 YAML Pecl PHP 扩展

php - 用igbinary安装php redis,找不到头文件

php - 嵌入 php 和 javascript 的问题

python - 从 bash 脚本调用时获取 Python 命令行输出

php - 正则表达式 PHP 仅在未被引号包围时才匹配

ubuntu - kubernetes minikube 不能与 mount 一起使用

perl - 如何告诉 PostgreSQL 使用其他 Perl 版本?

php - 静态编译 php pecl 扩展(在二进制文件中与 extension=ext.so)会提高性能吗?

php - 如何使用 MySQL SELECT 结果作为变量,然后在另一个 SELECT/UNION 语句中使用变量?

Php - 使用 join() 时我可以忽略/跳过空字符串吗