First time here? Check out the FAQ!
THIS IS A TEST INSTANCE. Feel free to ask and answer questions, but take care to avoid triggering too many notifications.
0

problem compiling tshark statically

  • retag add tags

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.

tje210's avatar
1
tje210
asked 2022-09-10 18:44:06 +0000
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

0

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

Chuckc's avatar
3k
Chuckc
answered 2022-09-10 19:28:04 +0000
edit flag offensive 0 remove flag delete link

Comments

add a comment see more comments

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss.

Add Answer