简体   繁体   English

升级到 Catalina 10.15 后无法在 Mac 上编译 C 程序

[英]Can't compile a C program on a Mac after upgrading to Catalina 10.15

There's a previous question Can't compile C program on a Mac after upgrade to Mojave , and the answers to that have covered most of the variations on what goes wrong. 升级到 Mojave 后,有一个先前的问题 Can't compile C program on a Mac on a Mojave ,并且该问题的答案涵盖了大多数问题的变化。

Now — as of Monday 2019-10-07 — you can upgrade to macOS Catalina 10.15.现在——从 2019 年 10 月 7 日星期一开始——您可以升级到 macOS Catalina 10.15。 Once again, during the upgrade, the /usr/include directory has been blown away by the update, even though XCode 11.0 was installed before upgrading (from Mojave 10.14.6) to Catalina.再一次,在升级过程中, /usr/include目录已被更新吹走,即使在升级(从 Mojave 10.14.6)到 Catalina 之前安装了 XCode 11.0。 Consequently, compilers built to expect that there is a /usr/include directory do not work any longer.因此,预期存在/usr/include目录的编译器不再工作。

The main recommended step for the Mojave issues — using the command: Mojave 问题的主要推荐步骤 - 使用命令:

 open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg

does not work out of the gate because the directory /Library/Developer/CommandLineTools/Packages/ does not exist (so there's not yet a .pkg file to open).由于目录/Library/Developer/CommandLineTools/Packages/不存在(因此还没有要打开的.pkg文件),因此无法正常工作。

Is there a good (official) way to create and populate the directory /usr/include ?有没有一种好的(官方)方法来创建和填充目录/usr/include

Before you proceed, make sure to install xcode command line tools.在继续之前,请确保安装 xcode 命令行工具。

xcode-select --install

Actually, you can do it: Actually all the C headers are found here in this folder:实际上,您可以做到:实际上所有 C 标头都可以在此文件夹中找到:

/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/

We just need to create symlink for all the headers file into this folder:我们只需要为这个文件夹中的所有头文件创建符号链接:

/usr/local/include/

It worked for me: the following command line will take care of all the problems:它对我有用:以下命令行将解决所有问题:

sudo ln -s /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/* /usr/local/include/

You will get some warning.你会得到一些警告。 Some of the headers already exists, like this:一些标头已经存在,如下所示:

ln: /usr/local/include//tcl.h: File exists
ln: /usr/local/include//tclDecls.h: File exists
ln: /usr/local/include//tclPlatDecls.h: File exists
ln: /usr/local/include//tclTomMath.h: File exists
ln: /usr/local/include//tclTomMathDecls.h: File exists
ln: /usr/local/include//tk.h: File exists
ln: /usr/local/include//tkDecls.h: File exists
ln: /usr/local/include//tkPlatDecls.h: File exists

totally ok to ignore.完全可以忽略。 that's all.就这样。

For me adding the following path to CPATH solved the issue:对我来说,将以下路径添加到CPATH解决了这个问题:

export CPATH=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include

TL;DR TL;博士

It appears that Apple considers /usr/include as something that has gone the way of the dodo — it is extinct — or maybe it's like Monty Python's Parrot .似乎 Apple 认为/usr/include已经走上了渡渡鸟的道路——它已经灭绝——或者它可能就像 Monty Python 的Parrot一样。

Using the Apple-provided GCC (actually, that's Clang by any other name, as the version information shows) or Clang avoids problems.使用 Apple 提供的 GCC(实际上是 Clang,如版本信息所示)或 Clang 可以避免出现问题。 Both /usr/bin/gcc and /usr/bin/clang will find the system libraries four directory levels below: /usr/bin/gcc/usr/bin/clang都会在以下四个目录级别找到系统库:

/Applications/Xcode.app/Contents/Developer/Platforms/…

If you build your own GCC or other compiler, you will (probably) need to configure it to find the system libraries under the Xcode application directory.如果您构建自己的 GCC 或其他编译器,您将(可能)需要对其进行配置以在 Xcode 应用程序目录下找到系统库。

Explorations探索

Immediately after the upgrade, I ran XCode 11.0.升级后,我立即运行 XCode 11.0。 It wanted to install some extra components, so I let it do so.它想安装一些额外的组件,所以我让它这样做。 However, that did not reinstate /usr/include or the directory under /Library .但是,这并没有恢复/usr/include/Library下的目录。

One of the other bits of advice in the previous question was to run:上一个问题中的其他建议之一是运行:

 xcode-select --install

When doing so, it claimed that it downloaded the command line utilities, and it ensured that /usr/bin/gcc and /usr/bin/clang etc were present.这样做时,它声称它下载了命令行实用程序,并确保存在/usr/bin/gcc/usr/bin/clang等。 That's a useful step (though I didn't definitively check whether they were present before).这是一个有用的步骤(尽管我没有明确检查它们之前是否存在)。

$ /usr/bin/gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 11.0.0 (clang-1100.0.33.8)
Target: x86_64-apple-darwin19.0.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
$

Using /usr/bin/gcc , it is now possible to compile programs:使用/usr/bin/gcc ,现在可以编译程序:

$ make CC=/usr/bin/gcc al
co  RCS/al.c,v al.c
RCS/al.c,v  -->  al.c
revision 1.7
done
/usr/bin/gcc -I/Users/jleffler/inc -g -O3 -std=c11 -pedantic -Wall -Wextra -Werror -Wshadow -Wmissing-prototypes -Wpointer-arith  -Wold-style-definition -Wcast-qual -Wstrict-prototypes -DHAVE_MEMMEM -DHAVE_STRNDUP -DHAVE_STRNLEN  -DHAVE_GETDELIM   -o al al.c -L/Users/jleffler/lib/64  -ljl
$

However, /usr/include is still missing.但是, /usr/include仍然缺失。 There is a directory under /Library now: /Library下现在有一个目录:

$ ls /Library/Developer
CommandLineTools  PrivateFrameworks
$ ls /Library/Developer/CommandLineTools
Library SDKs    usr
$ ls /Library/Developer/CommandLineTools/SDKs
MacOSX.sdk      MacOSX10.14.sdk MacOSX10.15.sdk
$ ls /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/
Entitlements.plist SDKSettings.json   System
Library            SDKSettings.plist  usr
$

Neither the System nor the Library directory contain anything very promising. SystemLibrary目录都不包含任何非常有前途的东西。

When all else fails, read the manual当所有其他方法都失败时,请阅读手册

Next step — find and read the release notes:下一步——查找并阅读发行说明:

There's no information in there that relates to this.那里没有与此相关的信息。 So, the probability is (AFAICS, after only an hour or two's effort) that Apple no longer support /usr/include — though it does still have a fully-loaded /usr/lib (no /lib though).因此,Apple 不再支持/usr/include的可能性是(AFAICS,仅经过一两个小时的努力)——尽管它仍然有一个完全加载的/usr/lib (虽然没有/lib )。

Time to check another compilation with GCC option -v added (in the makefile I used, setting UFLAGS adds the option to C compiler command line):是时候使用 GCC 选项检查另一个编译-v添加(在我使用的 makefile 中,设置UFLAGS将选项添加到 C 编译器命令行):

$ make UFLAGS=-v CC=/usr/bin/gcc ww
co  RCS/ww.c,v ww.c
RCS/ww.c,v  -->  ww.c
revision 4.9
done
/usr/bin/gcc -I/Users/jleffler/inc -g -O3 -std=c11 -pedantic -Wall -Wextra -Werror -Wshadow -Wmissing-prototypes -Wpointer-arith  -Wold-style-definition -Wcast-qual -Wstrict-prototypes -DHAVE_MEMMEM -DHAVE_STRNDUP -DHAVE_STRNLEN  -DHAVE_GETDELIM -v  -o ww ww.c -L/Users/jleffler/lib/64  -ljl
Apple clang version 11.0.0 (clang-1100.0.33.8)
Target: x86_64-apple-darwin19.0.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" -cc1 -triple x86_64-apple-macosx10.15.0 -Wdeprecated-objc-isa-usage -Werror=deprecated-objc-isa-usage -emit-obj -disable-free -disable-llvm-verifier -discard-value-names -main-file-name ww.c -mrelocation-model pic -pic-level 2 -mthread-model posix -mdisable-fp-elim -fno-strict-return -masm-verbose -munwind-tables -target-sdk-version=10.15 -target-cpu penryn -dwarf-column-info -debug-info-kind=standalone -dwarf-version=4 -debugger-tuning=lldb -ggnu-pubnames -target-linker-version 512.4 -v -resource-dir /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/11.0.0 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -I /Users/jleffler/inc -D HAVE_MEMMEM -D HAVE_STRNDUP -D HAVE_STRNLEN -D HAVE_GETDELIM -I/usr/local/include -O3 -Wall -Wextra -Werror -Wshadow -Wmissing-prototypes -Wpointer-arith -Wold-style-definition -Wcast-qual -Wstrict-prototypes -Wno-framework-include-private-from-public -Wno-atimport-in-framework-header -Wno-extra-semi-stmt -Wno-quoted-include-in-framework-header -pedantic -std=c11 -fdebug-compilation-dir /Users/jleffler/src/cmd -ferror-limit 19 -fmessage-length 110 -stack-protector 1 -fstack-check -mdarwin-stkchk-strong-link -fblocks -fencode-extended-block-signature -fregister-global-dtors-with-atexit -fobjc-runtime=macosx-10.15.0 -fmax-type-align=16 -fdiagnostics-show-option -fcolor-diagnostics -vectorize-loops -vectorize-slp -o /var/folders/77/zx9nk6dn7_dg4xd4stvt42v00000gn/T/ww-4cb85b.o -x c ww.c
clang -cc1 version 11.0.0 (clang-1100.0.33.8) default target x86_64-apple-darwin19.0.0
ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/local/include"
ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/Library/Frameworks"
#include "..." search starts here:
#include <...> search starts here:
 /Users/jleffler/inc
 /usr/local/include
 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/11.0.0/include
 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include
 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include
 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks (framework directory)
End of search list.
 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -lto_library /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib -dynamic -arch x86_64 -macosx_version_min 10.15.0 -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -o ww -L/Users/jleffler/lib/64 /var/folders/77/zx9nk6dn7_dg4xd4stvt42v00000gn/T/ww-4cb85b.o -ljl -L/usr/local/lib -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/11.0.0/lib/darwin/libclang_rt.osx.a
 "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/dsymutil" -o ww.dSYM ww
$

The key information in that blizzard of data is:暴风雪中的关键信息是:

-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk

That's effectively the 'root' directory for the compilation, so there should be sub-directories under that for usr and usr/include :这实际上是编译的“根”目录,因此在该目录下应该有usrusr/include的子目录:

$ ls /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk
Entitlements.plist SDKSettings.json   System
Library            SDKSettings.plist  usr
$ ls /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr
bin     include lib     libexec share
$ ls /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include
AppleTextureEncoder.h  dns_util.h             memory.h               simd
AssertMacros.h         dtrace.h               menu.h                 slapi-plugin.h
Availability.h         editline               miscfs                 spawn.h
AvailabilityInternal.h err.h                  module.modulemap       sqlite3.h
AvailabilityMacros.h   errno.h                monetary.h             sqlite3ext.h
AvailabilityVersions.h eti.h                  monitor.h              stab.h
…lots more lines…
dirent.h               mach-o                 security               xcselect.h
disktab.h              mach_debug             semaphore.h            xlocale
dispatch               machine                servers                xlocale.h
dlfcn.h                malloc                 setjmp.h               xpc
dns.h                  math.h                 sgtty.h                zconf.h
dns_sd.h               membership.h           signal.h               zlib.h
$

This shows that the mile-long and totally unmemorable directory name does contain the standard C and POSIX headers, plus Apple-specific extras.这表明一英里长且完全无法记住的目录名称确实包含标准的 C 和 POSIX 标头,以及 Apple 特定的附加内容。

The previous /usr/local/ directory appears to be intact;之前的/usr/local/目录似乎完好无损; the warning about usr/local/include not existing under the -isysrootdir is harmless (and not visible without the -v option). -isysrootdir下不存在有关usr/local/include的警告是无害的(如果没有-v选项,则不可见)。

Set the following implicit Make variables to point to where the headers are now located for Xcode Command Line Tools (Xcode CLI):将以下隐式Make变量设置为指向 Xcode 命令行工具 (Xcode CLI) 的标头现在所在的位置:

export CFLAGS+=-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
export CCFLAGS+=-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
export CXXFLAGS+=-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
export CPPFLAGS+=-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk

The -isysroot option updates the location of the root files away from the system root directory / . -isysroot选项将根文件的位置更新为远离系统根目录/

So, this ensures that the common /usr/* files are found in their new place.因此,这可确保在新位置找到常见的/usr/*文件。

That is, the files at /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk are now found.也就是说,现在找到/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk中的文件。 These files are:这些文件是:

Entitlements.plist 
Library
SDKSettings.json
SDKSettings.plist
System
usr

I am a newbie with C++ compiler for R in OSX and I got the same issue that C++ could not find the header after OS was updated ( missing math.h although it was there ). I am a newbie with C++ compiler for R in OSX and I got the same issue that C++ could not find the header after OS was updated ( missing math.h although it was there ). I followed instructions from https://thecoatlessprofessor.com/programming/cpp/r-compiler-tools-for-rcpp-on-macos/ but nothing changed.我按照https://thecoatlessprofessor.com/programming/cpp/r-compiler-tools-for-rcpp-on-macos/的说明进行操作,但没有任何改变。

Finally, it worked for me after I reinstalled the Xcode CLI最后,在我重新安装 Xcode CLI 后,它对我有用

xcode-select --install

and then change the flags to Var as @Coatless suggested:然后按照@Coatless 的建议将标志更改为 Var:

export CFLAGS=-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
export CCFLAGS=-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
export CXXFLAGS=-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
export CPPFLAGS=-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk

On MacOS Catalina 10.15.4, with Xcode Version 11.5 (11E608c) I also needed to update the library path in my.zshrc (the MacOSX.sdk paths are new):在 MacOS Catalina 10.15.4 上,使用 Xcode 版本 11.5 (11E608c) 我还需要更新 my.zshrc 中的库路径(MacOSX.sdk 路径是新的):

export CPATH='/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include:/opt/local/include'
export LIBRARY_PATH='/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib:/opt/local/lib'

For me, it works well as follow:对我来说,它的工作原理如下:

1. xcode-select --install

2. sudo ln -s /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/* /usr/local/include/

3. export SDKROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk

If you have both the command line tools and XCode installed, make sure the SDK installed by the command line tools is actually being used:如果您同时安装了命令行工具和 XCode,请确保实际使用了命令行工具安装的 SDK:

#Check the current sdk #查看当前的sdk

$ xcrun --show-sdk-path

#Change sdk #更改 sdk

$ sudo xcode-select -s /Library/Developer/CommandLineTools #Using CommandLineTools SDK

$ sudo xcode-select -s /Applications/Xcode.app/Contents/Developer #Using XCode.app SDK

kudos to https://stackoverflow.com/a/61526989/596599 for this answer.感谢 https://stackoverflow.com/a/61526989/596599这个答案。

In my case I seemed to have llvm and gcc also installed using homebrew.就我而言,我似乎也使用自制软件安装了llvmgcc When I removed those, and thus relied fully on the macOS clang, it could find the headers and the compiling worked again.当我删除这些并因此完全依赖 macOS clang 时,它可以找到标题并且编译再次工作。

If using an external LLVM installation, add these to your ~/.bash_profile如果使用外部 LLVM 安装,请将这些添加到您的~/.bash_profile

LLVM_PATH="/usr/local/opt/llvm/" # or any other path
LLVM_VERSION="11.0.0"
export PATH="$LLVM_PATH:$PATH"
export SDKROOT=$(xcrun --sdk macosx --show-sdk-path)
export LD_LIBRARY_PATH="$LLVM_PATH/lib/:$LD_LIBRARY_PATH"
export DYLD_LIBRARY_PATH="$LLVM_PATH/lib/:$DYLD_LIBRARY_PATH"
export CPATH="$LLVM_PATH/lib/clang/$LLVM_VERSION/include/"
export LDFLAGS="-L$LLVM_PATH/lib"
export CPPFLAGS="-I$LLVM_PATH/include"
export CC="$LLVM_PATH/bin/clang"
export CXX="$LLVM_PATH/bin/clang++"

(adjust the clang version and the external llvm installation path.) (调整clang版本和外部llvm安装路径。)

Then run source ~/.bash_profile然后运行source ~/.bash_profile

apue.h dependency was still missing in my /usr/local/include after following Komol Nath Roy answer in this question.在遵循Komol Nath Roy在这个问题中的回答之后,我的/usr/local/include中仍然缺少 apue.h 依赖项。

I downloaded the dependency manually from git and placed it in /usr/local/include我从 git 手动下载了依赖项并将其放在/usr/local/include

The solution was simpler than I thought.解决方案比我想象的要简单。 Install clang/llvm.安装 clang/llvm。

brew install llvm

Then we need to create symlinks ourselves.然后我们需要自己创建符号链接。

for f in /usr/local/Cellar/llvm/9.0.0_1/bin/clang*; do ln -s ${f} /usr/local/bin/"${f##*/}"; done

And

ln -s /usr/local/Cellar/llvm/9.0.0_1/include/c++ /usr/local/include/c++

Depending upon your llvm version, modify the above commands.根据您的 llvm 版本,修改上述命令。

Now, you can compile C++ programs without passing any custom flags.现在,您可以在不传递任何自定义标志的情况下编译 C++ 程序。

clang++ hello.cpp

I tried 1) manually linking 2) brew install llvm, but they did not work.我试过 1) 手动链接 2) brew install llvm,但它们没有用。

Finally, this worked for me: https://gitmemory.com/issue/pytorch/pytorch/31190/565153503最后,这对我有用:https://gitmemory.com/issue/pytorch/pytorch/31190/565153503

By setting the following env vars:通过设置以下环境变量:

export CC=clang
export CXX=clang++
export MACOSX_DEPLOYMENT_TARGET=10.9

Short Answer简答

/Library/Developer/CommandLineTools/usr/bin/clang++ -o main main.cpp -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk

The Result结果

Explanation解释

In current macOS version, the c/c++ headers are searched inside /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/ , instead of /usr/include .在当前的 macOS 版本中,在/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/中搜索 c/c++ 标头,而不是/usr/include So you need to 'reset' the root directory using -isysroot option.因此,您需要使用-isysroot选项“重置”根目录。

Hope this makes sense.希望这是有道理的。

In my case, i did a millions things but i reckon following steps helped fix ruby installation.就我而言,我做了数百万件事,但我认为以下步骤有助于修复 ruby 安装。

  1. xcode-select --install
  2. Set these flags设置这些标志
export CFLAGS=-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
export CCFLAGS=-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
export CXXFLAGS=-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
export CPPFLAGS=-isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk
  1. sudo ln -s /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/* /usr/local/include/

  2. export SDKROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk

  3. rbenv install 2.6.3 -v

For me the error was: xcrun[20873:1179298] Failed to open macho file at /Library/Developer/CommandLineTools/usr/bin/clang++ for reading: Too many levels of symbolic links对我来说,错误是: xcrun[20873:1179298] Failed to open macho file at /Library/Developer/CommandLineTools/usr/bin/clang++ for reading: Too many levels of symbolic links

So I opened my terminal and went to the following folder (as mentioned by the error message): /Library/Developer/CommandLineTools/usr/bin/所以我打开我的终端并转到以下文件夹(如错误消息所述): /Library/Developer/CommandLineTools/usr/bin/

Then I deleted the shortcut file named clang++然后我删除了名为clang++的快捷方式文件

sudo rm clang++

Next, I made a copy of executable file named clang and renamed the copied file to clang++接下来,我复制了一个名为clang的可执行文件并将复制的文件重命名为clang++

sudo cp clang clang++

And finally it works.最后它起作用了。

Works fine in Xcode Version 11.2 beta (11B41)在 Xcode 版本 11.2 beta (11B41) 中工作正常

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM