我不知何故丢失了gcc和g ++的手册页。我不确定在哪里/找什么。我很确定这些人工页面曾经使用过。它也可以在我的Mac上工作,我使用大致相同的设置。这可能是酿造的问题吗?或者它是XCode命令行工具中的错误?
更新:我刚刚尝试重新安装XCode命令行工具。没运气。
~
✓ man gcc
No manual entry for gcc
~
✗ which gcc
/usr/bin/gcc
~
✓ gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin13.1.0
Thread model: posix
Xcode不再安装gcc,它确实安装了clang并将其命名为gcc
usxxplayegm1:~ grady$ which gcc
/usr/bin/gcc
usxxplayegm1:~ grady$ /usr/bin/gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 5.1 (clang-503.0.38) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin13.0.2
Thread model: posix
你需要man clang
我认为这是一个符号链接,但是ls -l
没有将它列为符号链接,因此要么是硬链接,要么是其他类型的诡计。
看看你如何在你的MANPATH
中设置.profile
。而不是,例如,
export MANPATH=/opt/local/man:/usr/local/man
你应该做
export MANPATH="/opt/local/man:/usr/local/man:$MANPATH"
然后(呼吸)打开一个新的终端窗口。
这样你的.profile
就不会消除(或反映旧版本)系统设置MANPATH
的方式,当你安装(或重新安装)Xcode时会修改它。
我使用High Sierra和g ++ 7.2端口。将MANPATH环境设置为/ opt / local / man(或找到g ++ .gz的/ opt / local / man / man1)不起作用。因此,在确保软链接g ++ .gz指向g ++ - mp-7.1.gz(man1目录中没有g ++ - mp-7.2.gz,虽然g ++ 7.2是我的版本)之后,我总是使用命令:
man /opt/local/share/man/man1/g++.gz
永远不会失败。如果经常使用g ++的man命令,可以在.profile中存储别名。