请教ldd用法
背景:学习动态库的过程中遇到ldd的问题。源码:
hello.c
#include <stdio.h>
void hello()
{
printf("hello world.\n");
}test.c
#include<stdio.h>
int main()
{
printf("call hello().\n");
hello();
}
$gcc -shared hello.c -o libhello.so -fPIC
$gcc test.c -L. -lhello -o test
$echo "/tmp/lib">> /etc/ld.so.conf
$ldconfig
$./test
call hello().
hello world.
$ldd -u test
Unused direct dependencies:
/tmp/lib/libhello.so
问题:
为什么ldd -u的结果里,libhello属于unused呢?
页:
[1]