Homebrew can't install SDL_image and SDL_ttf (macos verson 10.13.6 High Sierra)

28 Views Asked by At

When i try to install with homebrew

brew install sdl2_ttf

and this is what i've got

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.

And when i do with sdl2_image

brew install sdl2_image

i've got this

==> ./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

i try to install compiler for c++

brew install gcc

or

brew install llvm

but i can't install them,too

i'm stuck with it

1

There are 1 best solutions below

0
Cyao On

To use them just download the libs directly from github.

For example go here for sdl ttf, download the .dmg file, open it and drag the .framework files to /Library/Frameworks