在 MacOS arm64e 中安装 php-decimal 并且无法获取 libmpdec

Installing php-decimal in MacOS arm64e and can't get libmpdec

我刚刚升级到配备 M1 的 MacBook,在安装带有 pecl install decimal 的 php-decimal 时,我收到以下错误:

checking for libmpdec custom path... no
checking for libmpdec library in default path... found in /usr/local/lib
checking for libmpdec headers in default path... found in /usr/local/include
checking for mpd_version in -lmpdec... no
configure: error: Please check your version of libmpdec (2.4+)
ERROR: `/private/tmp/pear/temp/decimal/configure --with-php-config=/Applications/MAMP/bin/php/php8.0.8/bin/php-config' failed

我使用自制软件安装了 libmpdec brew install mpdecimal,我可以在 usr/local/lib 看到文件 - 它们是自制软件位置的别名,这些文件:

我只是没主意了。

远古魔法正在寻找一个名为mpd_version的函数来判断你的库版本是否有那个函数。

因为您显然在某处安装了版本 2.5.1 和 3,所以应该可以找到它。但该错误消息可能会导致 headers 的旧版本出现在目录 /usr/local/include.

您能否查看 /usr/local/include 中的文件 mpdecimal.h 以查看该文件是否存在于其中,并包含函数 mpd_version 的定义。

虽然它也可能在链接步骤失败。您应该能够通过 运行 nm -gC libmpdec.a 或类似的方式转储出库中存在的符号。