Dell SUSE Enterprise を使用しています。選択の余地ない。
SUSE の zypper リポジトリには、libpcap-devel や同様のものはありません。
GIT リポジトリから libpcap をダウンロードしてインストールしました。libpcap では、flex と bison の両方をコンパイルする必要があります。flex バージョン 2.5.35 はリポジトリにあり、bison も同様です。
ただし、libpcap-devel を使用してコンパイルする問題は発生しません。libpcap.so でリンクしようとすると、autoconf スクリプトが失敗します。
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 で適切にコンパイルされない理由を理解しようとしています。誰も手がかりを持っていますか?