ldd 命令可以查看编译出来的可执行程序在运行时用到了那些库。
[root@localhost lesson_01]# ls
main main.c main.o Makefile tool.c tool.h tool.o
[root@localhost lesson_01]# ./main
max=8
[root@localhost lesson_01]# ldd main
linux-vdso.so.1 => (0x00007ffef6ddb000)
libc.so.6 => /lib64/libc.so.6 (0x00007efceb791000)
/lib64/ld-linux-x86-64.so.2 (0x00007efcebb5f000)
[root@localhost lesson_01]#
[root@localhost lesson_14]# ls
auto_ptr.cpp auto_ptr.o unique_ptr unique_ptr.cpp unique_ptr.o
[root@localhost lesson_14]# ./unique_ptr
*u_i: 3
*u_str: hello world
u_str2: nice day
u_str4: china
u_str6: beijing
u_str6 is null 0
u_str6 不是空指针: 0 value is: beijing
u_str6 是空指针
10
[root@localhost lesson_14]# ldd unique_ptr
linux-vdso.so.1 => (0x00007ffe64b21000)
libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007f296e629000)
libm.so.6 => /lib64/libm.so.6 (0x00007f296e327000)
libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f296e111000)
libc.so.6 => /lib64/libc.so.6 (0x00007f296dd43000)
/lib64/ld-linux-x86-64.so.2 (0x00007f296e931000)
[root@localhost lesson_14]#