我刚刚拿到了新的 M1 MacBook Pro,正在尝试编译大学工作所需的代码库。以下是我已采取的步骤:
using /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" brew install cmakecmake <path to source>(这很好用)make(失败)这是我得到的错误:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/stdlib.h:97:15: fatal error:
'stdlib.h' file not found
#include_next <stdlib.h>
Run Code Online (Sandbox Code Playgroud)
我尝试卸载并重新安装 Xcode 和 CommandLineTools,但无济于事。
使用 cmake gui 应用程序时,我收到不同的错误。我将其设置为使用 CommandLineTools/SDKs/MacOsX11.0.sdk。
使用此 cmake gui 设置生成和配置构建文件后运行时make,出现以下错误:
-- The C compiler identification is AppleClang 12.0.0.12000032
-- The CXX compiler identification is AppleClang 12.0.0.12000032
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info …Run Code Online (Sandbox Code Playgroud)