You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

macOS下使用Homebrew运行make编译报错缺失头文件求助

macOS Homebrew安装webp编译报错解决方案
  • 修正Xcode命令行工具指向
    执行以下命令校验路径:
    xcode-select -p
    若输出路径不为/Library/Developer/CommandLineTools,执行切换命令:
    sudo xcode-select --switch /Library/Developer/CommandLineTools
    sudo xcodebuild -license accept
    
  • 补充系统头文件搜索路径
    cstddef.h、string.h属于MacOSX SDK内置标准头文件,可临时注入环境变量执行安装:
    CFLAGS="-I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include" CPPFLAGS="-I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include" brew install webp
  • 解决SDL.h缺失问题
    SDL.h属于sdl2库的头文件,先安装对应依赖再安装webp即可:
    brew install sdl2
    brew install webp
    
    若不需要webp的SDL相关功能,也可禁用SDL编译选项:
    brew install webp --without-sdl
  • 跳过本地编译直接使用预编译包
    若无需自定义编译参数,可直接安装Homebrew预编译的二进制包,跳过本地make环节:
    brew install --force-bottle webp

内容的提问来源于stack exchange,提问作者Miles Acq

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.09.23 14:15:07