0

我们正在使用戴尔 SUSE Enterprise。没有选择。

SUSE 在 zypper 存储库中没有 libpcap-devel 或任何类似的东西。

我已经从 GIT 存储库下载并安装了 libpcap。libpcap 需要编译 flex 和 bison。flex 版本 2.5.35 在 repo 中,bison 也是。

但是,使用 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,我发现:

$ nm /usr/local/lib/libpcap.so | grep pcap_lex
                 U pcap_lex

当然,pcap_lex 确实是来自 yylex 的#define。

我不在这里。我试图弄清楚为什么这些东西都不能在 Suse 上正确编译。有人有线索吗?

4

1 回答 1

0

不知何故,无论您为编译 libpcap 所做的一切都会导致它无法正确构建。

没有:

  1. the config.log file from the libpcap directory;
  2. the Makefile from the libpcap directory;
  3. the output of the build in the libpcap directory;

it will be impossible to determine what that was, and thus it will be impossible to fix the process so that libpcap builds correctly. I have never seen a problem with libpcaps built on Linux, so I cannot determine what's happening here.

(If you supply this information, you will be helping not only yourself but all the people who have reported similar problems but have refused to respond to similar questions and thus have not supplied any of the information in question.)

于 2012-03-13T07:29:04.260 回答