unix中的C 编译器版本

c++ compiler version in unix

本文关键字:版本 编译器 中的 unix      更新时间:2023-10-16

我想在Unix环境下知道服务器的编译器版本(CC)。显然,我找到了安装编译器的正确目录

    cngsitbe1a@/opt/SUNWspro/prod/bin$ ls -ltr
    total 82225
    -rwxr-xr-x   1 root     sys        22864 Apr 30  2007 libsunperf_check
    -rwxr-xr-x   1 root     sys      1193036 May  3  2007 acomp
    -rwxr-xr-x   1 root     sys       480752 May  3  2007 fbe
    -rwxr-xr-x   1 root     sys      8298296 May  3  2007 cg
    -rwxr-xr-x   1 root     sys      6454044 May  3  2007 iropt
    -rwxr-xr-x   1 root     sys      5294740 May  3  2007 ccfe
    -rwxr-xr-x   1 root     sys       534392 May  3  2007 CClink
    -rwxr-xr-x   1 root     sys       116212 May  3  2007 c++filt
    -rwxr-xr-x   1 root     sys        18580 May  3  2007 stdlibfilt
    -rwxr-xr-x   1 root     sys       539124 May  3  2007 CCadmin
    -rwxr-xr-x   1 root     sys         7408 May  3  2007 dem
    -rwxr-xr-x   1 root     sys          519 May  3  2007 ptclean
    -rwxr-xr-x   1 root     sys        30936 May  3  2007 cb
    -rwxr-xr-x   1 root     sys        16004 May  3  2007 nmf
    -rwxr-xr-x   1 root     sys        19216 May  3  2007 lpfx
    -rwxr-xr-x   1 root     sys        14944 May  3  2007 flip
    -rwxr-xr-x   1 root     sys        17172 May  3  2007 dag
    -rwxr-xr-x   1 root     sys         5118 May  3  2007 cflow
    -rwxr-xr-x   1 root     sys       101484 May  3  2007 cscope
    -rwxr-xr-x   1 root     sys         8920 May  3  2007 runtime.c
    -rwxr-xr-x   1 root     sys        63004 May  3  2007 ctrace
    -rwxr-xr-x   1 root     sys         3361 May  3  2007 ctcr
    -rwxr-xr-x   1 root     sys        21788 May  3  2007 xref
    -rwxr-xr-x   1 root     sys         4863 May  3  2007 cxref
    -rwxr-xr-x   1 root     sys        11508 May  3  2007 irprint
    -rwxr-xr-x   1 root     sys       358548 May  3  2007 CC
    -rwxr-xr-x   1 root     sys       246684 May  3  2007 lint
    -rwxr-xr-x   1 root     sys       276584 May  3  2007 cc

但是,当我使用命令查找CC版本时,没有提供有用的信息。

    cngsitbe1a@/opt/SUNWspro/prod/bin$ CC -V
    -bash: CC: command not found

此外,当在服务器A中编译二进制并在服务器B中部署/运行时,服务器B的编译器是否会影响二进制的触发?可以帮助?

使用

./CC -V

致电CC可执行文件,只要/opt/SUNWspro/prod/bin不属于PATH变量。


如注释中所述,大多数编译器都使用--version选项来检索当前版本。