0
我们正在使用Dell SUSE Enterprise。没有选择。无法在Dell SUSE Enterprise下编译libpcap
SUSE在zypper存储库中没有libpcap-devel或类似的东西。
我已经从GIT存储库下载并安装了libpcap。 libpcap需要编译flex和bison。 flex版本2.5.35和野牛一样在回购中。
但是,我不能得到任何使用libpcap-devel编译的问题。 autoconf的脚本上尝试在libpcap.so链接失败:
configure:3633: $? = 1
configure:3636: checking whether we are using the GNU C++ compiler
configure:3665: g++ -c conftest.cpp >&5
configure:3672: $? = 0
configure:3689: result: yes
configure:3698: checking whether g++ accepts -g
configure:3728: g++ -c -g conftest.cpp >&5
configure:3735: $? = 0
configure:3836: result: yes
configure:3861: checking dependency style of g++
configure:3952: result: gcc3
configure:3981: checking for a BSD-compatible install
configure:4049: result: /usr/bin/install -c
configure:4067: checking for pcap_lookupdev in -lpcap
configure:4102: gcc -o conftest -g -O2 conftest.c -lpcap >&5
/usr/local/lib/libpcap.so: undefined reference to `pcap_lex'
collect2: ld returned 1 exit status
configure:4109: $? = 1
configure: failed program was:
运行在归档处,我发现:
$ nm /usr/local/lib/libpcap.so | grep pcap_lex
U pcap_lex
当然
,pcap_lex是真正从函数yylex使用#define。
我不在这里。我试图弄清楚为什么这些东西没有在Suse上正确编译。有人有线索吗?
虽然技术上是正确的,但更好的方法是从http://www.tcpdump.org/下载libpcap 1.2.1源代码。该版本编译没有问题。所以真正的答案是不要从github随机发布。 – vy32 2012-03-14 00:00:15
那么,至少有一些其他报告这些问题的人报告了从tcpdump.org下载的标准版本的问题,所以这不一定是有保证的修复。 – 2012-03-14 05:52:57
或者在我的情况下,使用tcpdump.org文件成功构建了该库,但是当我尝试将其链接到项目时,出现此错误。 – 2016-01-05 21:13:15