0

Quoted from here:

  • If your program uses Win32 specific functions of WinPcap, remember to include WPCAP among the preprocessor definitions.

  • If your program uses the remote capture capabilities of WinPcap, add HAVE_REMOTE among the preprocessor definitions. Do not include remote-ext.h directly in your source files.

Has anyone managed to use winpcap with cmake?

Gtker
  • 2,237
  • 9
  • 29
  • 37

1 Answers1

0

Something like this should do it:

add_definitions(-DWPCAP -DHAVE_REMOTE)

find_path(WINPCAP_INCLUDE_DIR pcap.h
         ${WINPCAP_HINT_INCLUDE_DIR})

find_library(WINPCAP_LIBRARY NAMES "wpcap"
                             PATHS ${WINPCAP_HINT_LIB_DIR})

...

include_directories(${WINPCAP_INCLUDE_DIR})
target_link_library(my_lib ${WINPCAP_LIBRARY})
the_void
  • 5,512
  • 2
  • 28
  • 34