简体   繁体   English

man找不到与符号链接指向的源文件相关的手册页

[英]man does not find man pages associated with the source files pointed to by symbolic links

My hard drive recently crashed, so I took the opportunity to upgraded from Mac OS X 10.6.8 to 10.9.5 from a fresh install. 我的硬盘驱动器最近崩溃了,所以我借此机会从全新安装从Mac OS X 10.6.8升级到了10.9.5。 Mavericks comes with "gcc" Apple LLVM version 6.0 (clang-600.0.51). Mavericks随附了“ gcc” Apple LLVM 6.0版(clang-600.0.51)。 I want to use gcc-mp-4.8 that I downloaded from Macports. 我想使用从Macports下载的gcc-mp-4.8。

  1. So I renamed /usr/bin/gcc to /usr/bin/gcc_clang_6.0 所以我将/ usr / bin / gcc重命名为/usr/bin/gcc_clang_6.0
  2. In /opt/local/bin (where all the executables from Macports are installed), I created the symbolic link ... sudo ln -s gcc-mp-4.8 gcc 在/ opt / local / bin(安装了Macports的所有可执行文件)中,我创建了符号链接... sudo ln -s gcc-mp-4.8 gcc

I can compile using the command "gcc" and save myself the extra 7 key strokes (yay!). 我可以使用命令“ gcc”进行编译,并为自己节省了额外的7个按键(是!)。 However, if I want to look at "man gcc", man cannot find it. 但是,如果我要查看“ man gcc”,则man找不到它。 I would really like to be able to view the man page without having to type "man gcc-mp-4.8" 我真的很希望能够不必输入“ man gcc-mp-4.8”即可查看手册页

Is there a way to fix this? 有没有办法解决这个问题?

Thanks! 谢谢!

Previously, I did not understand how and where man pages are stored. 以前,我不了解手册页的存储方式和位置。 So for instance you can type man -w gcc-mp-4.8 , so to symbolically link them, I used sudo ln -s $(man -w gcc-mp-4.8) /opt/local/man/man1/gcc.1.gz . 因此,例如,您可以键入man -w gcc-mp-4.8 ,以便以符号方式链接它们,我使用了sudo ln -s $(man -w gcc-mp-4.8) /opt/local/man/man1/gcc.1.gz

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

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