Linux之查看系统glibc版本号(三十六)

编程入门 行业动态 更新时间:2024-10-27 00:25:21

Linux之查看系统glibc版本号 

1.第一种
# ldd --version
ldd (Ubuntu GLIBC 2.27-3ubuntu1) 2.27
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.

2.第二种
# ls -alh /lib/x86_64-linux-gnu/libc.so.6 
lrwxrwxrwx 1 root root 12 Apr 17  2018 /lib/x86_64-linux-gnu/libc.so.6 -> libc-2.27.so
注意:libc-2.27.so :版本号即2.27

# strings /lib/x86_64-linux-gnu/libc-2.27.so |grep -in5 version

GNU C Library (Ubuntu GLIBC 2.27-3ubuntu1) stable release version 2.27.
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

3.第三种
//glibc_version.c
#include <stdio.h>
#include <gnu/libc-version.h>
int main(void)
{
  printf("glic_version = %s\n",gnu_get_libc_version());
  return 0;
}
# gcc glibc_version.c
# ./a.out
glic_version = 2.27

更多推荐

Linux之查看系统glibc版本号(三十六)

本文发布于:2023-06-13 21:51:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1408787.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:版本号   系统   Linux   三十六   glibc

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!