64bit Centos系统中 Daq-2.0.6 编译
1. ./configure
2. make
3. make install
此时会出现如下错误:
libtool: install: /usr/bin/install -c .libs/daq_ipfw.soT /usr/local/lib/daq/daq_ipfw.so
libtool: install: /usr/bin/install -c .libs/daq_ipfw.lai /usr/local/lib/daq/daq_ipfw.la
libtool: warning: relinking 'daq_nfq.la'
libtool: install: (cd /usr/local/src/daq-2.0.6/os-daq-modules; /bin/sh "/usr/local/src/daq-2.0.6/libtool" --tag CC --mode=relink gcc -DBUILDING_SO -g -O2 -fvisibility=hidden -Wall -Wwrite-strings -Wsign-compare -Wcast-align -Wextra -Wformat -Wformat-security -Wno-unused-parameter -fno-strict-aliasing -fdiagnostics-show-option -pedantic -std=c99 -D_GNU_SOURCE -module -export-dynamic -avoid-version -shared -L/usr/local/lib -ldnet -o daq_nfq.la -rpath /usr/local/lib/daq daq_nfq_la-daq_nfq.lo -lnfnetlink -lnetfilter_queue -L/usr/local/lib -ldnet ../sfbpf/libsfbpf.la )
libtool: relink: gcc -shared -fPIC -DPIC .libs/daq_nfq_la-daq_nfq.o -Wl,-rpath -Wl,/usr/local/lib -L/usr/local/lib -lnfnetlink -lnetfilter_queue -ldnet -lsfbpf -g -O2 -Wl,-soname -Wl,daq_nfq.so -o .libs/daq_nfq.so
/usr/bin/ld: /usr/local/lib/libdnet.a(addr.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/libdnet.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
libtool: error: error: relink 'daq_nfq.la' with the above command before installing it
make[2]: *** [install-pkglibLTLIBRARIES] Error 1
make[2]: Leaving directory `/usr/local/src/daq-2.0.6/os-daq-modules'
make[1]: *** [install-am] Error 2
make[1]: Leaving directory `/usr/local/src/daq-2.0.6/os-daq-modules'
make: *** [install-recursive] Error 1
[root@localhost daq-2.0.6]#
原因:因为在64位centos下dent库的路径不是-L/usr/local/lib,而是/usr/lib64
解决方法:
1.修改libnet的安装路径库路径
2.修改编译第一步: ./configure --with-dnet-libraries=/usr/lib64,然后重新编译,编译成功 原文链接:https://www.f2er.com/centos/381964.html