首页 > 解决方案 > mozjpeg 预构建测试在带有 M1 的 macOS-x86_64 上失败

问题描述

我正在尝试在 npm (mozjpeg 5.1.0) 中使用 mozjpeg。因为预构建总是失败,我能够使用以下命令来安装依赖项并使其工作

brew install automake autoconf libtool dpkg pkgconfig nasm libpng

使用此命令,可以在 Mac OS X 10.15.7 上成功构建 mozjpeg。

现在在带有 M1 芯片的新 Mac 上,它不再工作了,它失败并显示以下消息:

ld: warning: ignoring file /opt/homebrew/Cellar/libpng/1.6.37/lib/libpng16.dylib, building for macOS-x86_64 but attempting to link with file built for macOS-arm64

架构 x86_64 的未定义符号:

我在这里做错了什么?

标签: macoshomebrewlibpngmozjpeg

解决方案


推荐阅读