我对MacOS环境还很陌生,以前在编译C脚本时遇到一些问题。我有以下问题:
fatal error: stdio.h: No such file or directory
#include <stdio.h>
^
compilation terminated.
Run Code Online (Sandbox Code Playgroud)
我尝试重新安装,xcode-select --install但一直告诉我
xcode-select:错误:命令行工具已经安装,请使用“软件更新”来安装更新
我什么都没更新。显然是因为我没有/usr/includes文件。我找到了一种使用来编译软件的方法
/Library/Developer/CommandLineTools/usr/bin/g++ XXXX.cpp
不过,现在我想./compile和make其他软件,但我不知道如何在默认情况下使用该GCC解释。当我尝试./configure时出现此错误
配置:错误:无法运行C编译程序。如果您打算交叉编译,请使用'--host'。有关更多详细信息,请参见“ config.log”
所以当我调查config.log:
configure:3224: checking for gcc
configure:3240: found /usr/local/bin/gcc
configure:3251: result: gcc
configure:3282: checking for C compiler version
configure:3291: gcc --version >&5
gcc (GCC) 4.9.2 20141029 (prerelease)
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; …Run Code Online (Sandbox Code Playgroud)