Homebrew 无法安装 SDL_image 和 SDL_ttf(macos 版本 10.13.6 High Sierra)

问题描述 投票:0回答:1

当我尝试使用自制程序安装时

brew install sdl2_ttf

这就是我所拥有的

Last 15 lines from /Users/mac/Library/Logs/Homebrew/ninja/01.python3:
when running:  clang++ -MMD -MT build/build.o -MF build/build.o.d -g -Wall -Wextra -Wno-deprecated -Wno-missing-field-initializers -Wno-unused-parameter -fno-rtti -fno-exceptions -fvisibility=hidden -pipe '-DNINJA_PYTHON="python3"' -O2 -DNDEBUG -fdiagnostics-color -DNINJA_HAVE_BROWSE -I. -c ./src/build.cc -o build/build.o
Traceback (most recent call last):
  File "/private/tmp/ninja-20240309-79981-9x80ru/ninja-1.11.1/configure.py", line 522, in <module>
    objs += cxx(name, variables=cxxvariables)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/private/tmp/ninja-20240309-79981-9x80ru/ninja-1.11.1/configure.py", line 287, in cxx
    return n.build(built(name + objext), 'cxx', src(name + '.cc'), **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/private/tmp/ninja-20240309-79981-9x80ru/ninja-1.11.1/configure.py", line 169, in build
    self._run_command(self._expand(cmd, local_vars))
  File "/private/tmp/ninja-20240309-79981-9x80ru/ninja-1.11.1/configure.py", line 194, in _run_command
    subprocess.check_call(cmdline, shell=True)
  File "/usr/local/Cellar/[email protected]/3.12.2_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/subprocess.py", line 413, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command 'clang++ -MMD -MT build/build.o -MF build/build.o.d -g -Wall -Wextra -Wno-deprecated -Wno-missing-field-initializers -Wno-unused-parameter -fno-rtti -fno-exceptions -fvisibility=hidden -pipe '-DNINJA_PYTHON="python3"' -O2 -DNDEBUG -fdiagnostics-color -DNINJA_HAVE_BROWSE -I. -c ./src/build.cc -o build/build.o' returned non-zero exit status 1.

当我使用 sdl2_image 时

brew install sdl2_image

我有这个

==> ./bootstrap --prefix=/usr/local/Cellar/cmake/3.28.3 --no-system-libs --parallel=4 --datadir=/share/cmake --docdir=/share/doc/cmake --mandir=/share/man --system-zlib --system-bzi
Last 15 lines from /Users/mac/Library/Logs/Homebrew/cmake/01.bootstrap:
-DCMake_BUILD_LTO=ON

---------------------------------------------
CMake 3.28.3, Copyright 2000-2023 Kitware, Inc. and Contributors
C compiler on this system is: clang   
---------------------------------------------
Error when bootstrapping CMake:
Cannot find a C++ compiler that supports both C++11 and the specified C++ flags.
Please specify one using environment variable CXX.
The C++ flags are "".
They can be changed using the environment variable CXXFLAGS.
See cmake_bootstrap.log for compilers attempted.
---------------------------------------------
Log of errors: /private/tmp/cmake-20240309-87315-euch3m/cmake-3.28.3/Bootstrap.cmk/cmake_bootstrap.log

我尝试安装 c++ 编译器

brew install gcc

brew install llvm

但我也无法安装它们

我被困住了

cmake homebrew sdl
1个回答
0
投票

要使用它们,只需直接从 github 下载库即可。

例如,前往此处获取 sdl ttf,下载 .dmg 文件,将其打开并将 .framework 文件拖至 /Library/Frameworks

© www.soinside.com 2019 - 2024. All rights reserved.