Skip to content

Mac Book Pro,Apple芯片 编译失败 #448

Answered by fw8899
maxfong asked this question in Q&A
Discussion options

You must be logged in to vote

是使用homebrew安装的libevent吗?
如果shell是x86_64(2023年之前大部分shell只有x86_86的homebrew,通过Rosetta转译运行),默认安装的lib也是x86_64的,和clang的编译目标arm64不匹配。可以在shell中使用arch命令来确认。

处理方法:

  1. 删除x86_64的libevent,brew uninstall --ignore-dependencies libevent
  2. 删除重新安装arm64版本的shell(比如最新版本的iTerm2)后,通过brew install libevent来安装。使用objdump等工具确认lib是否为arm64。
  3. 也可以用默认参数自行build libevent并install,或者使用vcpkg之类的包管理器作为依赖添加。

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by Yanmei-Liu
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants