我正在尝试构建一个 c 项目,我能够使用 cmake,它正在寻找 SDL。我还确认它是通过自制软件安装的,版本 2.26.3.
我在 macos Ventura 13.2.1 和 xcode 14.2 上使用 xcode 14.2 (14C18) 的命令行工具。在另一个 Stackoverflow 问题 中,他们提到这是一个没有安装 14.2 的问题,但我确认我已经安装了,但问题仍然存在。当我运行 make 时,出现以下错误:
[ 0%] Built target mgba-version-info
[ 44%] Built target mgba
[ 55%] Built target updater-stub
[ 55%] Building C object sdl/CMakeFiles/mgba-sdl.dir/sdl-audio.c.o
In file included from /Users/stegnerd/dev/c/mgba/src/platform/sdl/sdl-audio.c:6:
In file included from /Users/stegnerd/dev/c/mgba/src/platform/sdl/sdl-audio.h:15:
In file included from /usr/local/include/SDL2/SDL.h:32:
In file included from /usr/local/include/SDL2/SDL_main.h:25:
In file included from /usr/local/include/SDL2/SDL_stdinc.h:31:
In file included from /usr/local/include/SDL2/SDL_config.h:33:
/usr/local/include/SDL2/SDL_platform.h:112:3: error: SDL for Mac OS X only supports deploying on 10.7 and above.
# error SDL for Mac OS X only supports deploying on 10.7 and above.
^
1 error generated.
make[2]: *** [sdl/CMakeFiles/mgba-sdl.dir/sdl-audio.c.o] Error 1
make[1]: *** [sdl/CMakeFiles/mgba-sdl.dir/all] Error 2
make: *** [all] Error 2
我四处搜索,没有找到太多关于可能是什么问题的信息。我还为 xcode 重新安装了最新的命令行工具,以防万一问题仍然存在。
我的问题是任何人都可以解释为什么 make 无法看到 SDL2,或者如何解决 macos 10.7 或更高版本的错误。我对 C 或 make 不够熟悉,无法理解如何解决 make 未看到的 SDL。