简体   繁体   English

MacOS arm64e安装php-decimal无法获取libmpdec

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

I've just upgraded to a MacBook with the M1 and when installing php-decimal with pecl install decimal , I receive the following error:我刚刚升级到带有 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

I've used homebrew to install libmpdec brew install mpdecimal and I can see the files at usr/local/lib - they are aliases to the homebrew location with these files:我已经使用自制软件来安装 libmpdec brew install mpdecimal并且我可以在usr/local/lib看到这些文件 - 它们是带有这些文件的自制软件位置的别名:

  • libmpdec++.a libmpdec++.a
  • libmpdec++.2.5.1.dylib libmpdec++.2.5.1.dylib
  • libmpdec.a libmpdec.a
  • libmpdec.2.5.1.dylib libmpdec.2.5.1.dylib
  • libmpdec++.dylib libmpdec++.dylib
  • libmpdec++.3.dylib libmpdec++.3.dylib
  • libmpdec.dylib libmpdec.dylib
  • libmpdec.3.dylib libmpdec.3.dylib

I'm just out of ideas here.我只是在这里没有想法。

The ancient magic is looking for whether a function named mpd_version to determine if your version of the library has that function.古老的魔法是寻找一个名为 mpd_version 的函数来确定您的库版本是否具有该函数。

As you apparently have version 2.5.1 and 3 installed somewhere it should find it.由于您显然在某处安装了 2.5.1 和 3 版,因此应该可以找到它。 But the error message is one that could result in an older version of the headers being present the directory /usr/local/include.但该错误消息可能导致旧版本的头文件出现在目录 /usr/local/include 中。

Can you look at the file mpdecimal.h in /usr/local/include to see if that file is present in there, and contains a definition of the function mpd_version in it.您能否查看 /usr/local/include 中的文件 mpdecimal.h 以查看该文件是否存在于其中,并且其中包含函数 mpd_version 的定义。

Though it may also be failing at the linking step.虽然它也可能在链接步骤失败。 You should be able to dump out which symbols are present in the lib by running nm -gC libmpdec.a or similar.您应该能够通过运行nm -gC libmpdec.a或类似命令来转储 lib 中存在的符号。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM