目标:移植tcpdump的文件,apt-get source tcpdump 得到源代码,配置 ./configure --prefix=/home/apple/you/net/day01/test/bin_tcpdump/
缺少库文件:libpcap,apt-get source libpcap 得到库的源码,
2131 ./configure --prefix=/home/apple/you/net/day01/test/bin_libpcap/
2132 make
2133 make install
到
./configure --prefix=/home/apple/you/net/day01/test/bin_tcpdump/ --includedir=/home/apple/you/net/day01/test/bin_libpcap/include/ --libdir=/home/apple/you/net/day01/test/bin_libpcap/lib/make
出现error
/usr/local/ssl/lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_bind_func':
dso_dlfcn.c:(.text+0x2c8): undefined reference to `dlsym'
dso_dlfcn.c:(.text+0x38e): undefined reference to `dlerror'
/usr/local/ssl/lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_bind_var':
dso_dlfcn.c:(.text+0x404): undefined reference to `dlsym'
dso_dlfcn.c:(.text+0x4be): undefined reference to `dlerror'
/usr/local/ssl/lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_unload':
dso_dlfcn.c:(.text+0x51f): undefined reference to `dlclose'
/usr/local/ssl/lib/libcrypto.a(dso_dlfcn.o): In function `dlfcn_load':
dso_dlfcn.c:(.text+0x5d4): undefined reference to `dlopen'
dso_dlfcn.c:(.text+0x642): undefined reference to `dlclose'
dso_dlfcn.c:(.text+0x670): undefined reference to `dlerror'
collect2: ld returned 1 exit status
make: *** [tcpdump] Error 1
root@ubuntu:/home/apple/you/net/day01/test/tcpdump-4.0.0# ./configure --prefix=/home/apple/you/net/day01/test/bin_tcpdump/ --includedir=/home/apple/you/net/day01/test/bin_libpcap/include/ --libdir=/home/apple/you/net/day01/test/bin_libpcap/lib/ LDFLAGS=-ldl