This is a static archive of our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

Finding libpcap when using CMake

0

Hi,

I'm compiling from source on ARM based ubuntu (14.04) system similar to Raspberry Pi. I've hit the: tshark: This version of TShark was not built with support for capturing packets message and I've read that I must "use --with-pcap option in your configure."

I see the following files at the top level:

$ ls -1 *conf*
INSTALL.configure
cmakeconfig.h.in
config.guess
config.h
config.h.win32
config.nmake
config.sub
configure.ac

Where should I enable the use of pcap? Please be as specific as possible. Do I need to apt-get any other library for pcap?

I'm compiling by: cmake . && make

asked 21 May '16, 15:33

kupylin's gravatar image

kupylin
6112
accept rate: 0%

edited 21 May '16, 15:55

Guy%20Harris's gravatar image

Guy Harris ♦♦
17.4k335196

Where did you read the statement that you must "use --with-pcap option in your configure."? That statement needs to be updated to handle CMake as well as autoconf; --with-pcap is an autoconf option, and doesn't apply if you're using CMake.

(21 May '16, 15:57) Guy Harris ♦♦

Are you compiling on the ARM-based system to build a program to run on the same system, or are you compiling on some other system to produce a program to run on the ARM-based system, i.e. are you cross-compiling?

(21 May '16, 15:59) Guy Harris ♦♦

Hi, I'm doing a native compilation on the ARM based system that I intend to run. My installed compiler is gcc 4.8.x. I'll get back to you on where the message to use cap came from.

(31 May '16, 12:43) kupylin

One Answer:

0

You should get the libpcap development package libpcap0.8-dev. That provides you with the development files you need to compile using --with-pcap (which cmake should be able to find just fine actually).

answered 21 May '16, 15:59

Jaap's gravatar image

Jaap ♦
11.7k16101
accept rate: 14%

edited 21 May '16, 16:00

At least if this is doing a native compile. The package might have some other name if they're cross-compiling.

(21 May '16, 16:10) Guy Harris ♦♦

That provides you with the development files you need to compile using --with-pcap (which cmake should be able to find just fine actually).

Both CMake and autotools should find libpcap without any help if the development package is installed; no need for --with-pcap= with autotools or -DCMAKE_PREFIX_PATH= with CMake.

(21 May '16, 16:11) Guy Harris ♦♦