Ask Your Question
0

problem compiling tshark statically

asked 2022-09-10 18:44:06 +0000

tje210 gravatar image

I've been banging my head against this for 2 weeks. I'm not a developer, but I can generally use things pretty well. I'm running into this error while trying to compile wireshark statically -

tje210:/wireshark/build $ cmake ..
(lots of output...)
-- Found PCAP: /usr/lib/x86_64-linux-gnu/libpcap.a
-- Looking for pcap_lib_version
-- Looking for pcap_lib_version - not found
CMake Error at cmake/modules/FindPCAP.cmake:212 (message):
You need libpcap 0.8 or later
Call Stack (most recent call first):
CMakeLists.txt:1162 (find_package)
CMakeLists.txt:1211 (ws_find_package)

(end output)

How do I give cmake what it wants? The problem doesn't happen when I have these options -
option(ENABLE_STATIC "Build Wireshark libraries statically" ON)
option(USE_STATIC "Always link statically with external libraries" ON)

set to OFF.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-09-10 19:28:04 +0000

Chuckc gravatar image

This is the check in FindPCAP.cmake:

    # We check whether pcap_lib_version is defined in the pcap header,
    # using it as a proxy for all the 0.8 API's.  if not, we fail.
    #
    check_symbol_exists( pcap_lib_version ${PCAP_INCLUDE_DIR}/pcap.h HAVE_PCAP_LIB_VERSION )
    if( NOT HAVE_PCAP_LIB_VERSION )
      message(FATAL_ERROR "You need libpcap 0.8 or later")
    endif( NOT HAVE_PCAP_LIB_VERSION )

Either the build can't find pcap.h or the version you have doesn't have:

PCAP_API const char *pcap_lib_version(void);


(PCAP_LIB_VERSION(3PCAP)
From pcap.h:

/*
 * Version number of the current version of the pcap file format.
 *
 * NOTE: this is *NOT* the version number of the libpcap library.
 * To fetch the version information for the version of libpcap
 * you're using, use pcap_lib_version().
 */
#define PCAP_VERSION_MAJOR 2
#define PCAP_VERSION_MINOR 4

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2022-09-10 18:44:06 +0000

Seen: 57 times

Last updated: Sep 10