我的Mac找不到gcc。
DorothydeMacBook:Desktop dorothy$ gcc
-bash: gcc-8.0.2: command not found
但是它退出了。
DorothydeMacBook:Desktop dorothy$ which gcc
/usr/local/bin/gcc
我可以在/usr/local/bin
x86_64-apple-darwin18.2.0-c++-8
x86_64-apple-darwin18.2.0-g++-8
x86_64-apple-darwin18.2.0-gcc-8
x86_64-apple-darwin18.2.0-gcc-8.2.0
x86_64-apple-darwin18.2.0-gcc-ar-8
x86_64-apple-darwin18.2.0-gcc-nm-8
x86_64-apple-darwin18.2.0-gcc-ranlib-8
x86_64-apple-darwin18.2.0-gfortran-8
g++
g++-8
gcc
gcc-8
gcc-ar
gcc-ar-8
gcc-nm
gcc-nm-8
gcc-ranlib
gcc-ranlib-8
DorothydeMacBook:~ dorothy$ env
TERM_PROGRAM=Apple_Terminal
TERM=xterm-256color
SHELL=/bin/bash
TMPDIR=/var/folders/dg/l7bh29111hl_7jsfspzbs2d80000gn/T/
Apple_PubSub_Socket_Render=/private/tmp/com.apple.launchd.92LjvvFjN3/Render
TERM_PROGRAM_VERSION=421.1
OLDPWD=/Users/dorothy/Desktop
TERM_SESSION_ID=83E312BB-F4C2-4DA7-B123-38BAA4242C89
USER=dorothy
SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.Y7k1UOMg8c/Listeners
PATH=/Library/Frameworks/Python.framework/Versions/3.6/bin:/usr/local/Cellar/gcc/8.0.2/lib:/usr/local/Cellar/gcc/8.0.2/bin:/Library/Frameworks/Python.framework/Versions/3.6/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/usr/local/share/dotnet:/opt/X11/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Applications/Xamarin Workbooks.app/Contents/SharedSupport/path-bin
PWD=/Users/dorothyXPC_FLAGS=0x0
XPC_SERVICE_NAME=0
HOME=/Users/dorothy
SHLVL=1
LOGNAME=dorothy
LC_CTYPE=UTF-8
DISPLAY=/private/tmp/com.apple.launchd.U7xfsLeEtc/org.macosforge.xquartz:0
MyComputer=u1795058@joshua.dcs.warwick.ac.uk
SECURITYSESSIONID=186a8
_=/usr/bin/env
列出了系统路径的详细信息:
The /etc/profile
# System-wide .profile for sh(1)
if [ -x /usr/libexec/path_helper ]; then
eval `/usr/libexec/path_helper -s`
fi
if [ "${BASH-no}" != "no" ]; then
[ -r /etc/bashrc ] && . /etc/bashrc
fi
~
~
如何使用gcc?