我安装了libpcap。但是我不能用链接器不读取它。 我阅读了一些文章,但仍在关注他们,但无法在3天之内运行它。
cmake_minimum_required(VERSION 3.3)
project(untitled15)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
SET(GCC_COVERAGE_LINK_FLAGS "-lpcap")
SET(CMAKE_MODULE_PATH "/Users/sung_woo/Downloads/libpcap-1.9.1")
include(FindPCAP.cmake)
find_package(pcap)
set(SOURCE_FILES main.c)
add_executable(untitled ${SOURCE_FILES})
target_link_libraries(untitled ${pcap})