C++, WinPcap pcap_open() 함수에서 발생한 문제 입니다.
글쓴이: Reference / 작성시간: 토, 2022/01/01 - 9:31오전
https://www.winpcap.org/docs/docs_412/html/group__wpcap__tut3.html
/* Open the device */ if ( (adhandle= pcap_open(d->name, 65536, PCAP_OPENFLAG_PROMISCUOUS, 1000, NULL, errbuf ) ) == NULL) { fprintf(stderr,"\nUnable to open the adapter. %s is not supported by WinPcap\n", d->name); /* Free the device list */ pcap_freealldevs(alldevs); return -1; }
위 코드는 WinPcap 문서에 있는 코드인데 pcap_open 함수를 사용하려 하면 정의되어있지 않다고 나옵니다.
물론 pcap.h는 인클루드 했고요. 어떻게 해야 할까요?
Forums:
헤더 파일만 include한다고 끝이 아니지요.
헤더 파일만 include한다고 끝이 아니지요. (header-only library가 뭐 간혹 있기는 합니다만)
MS 개발환경 문제는 MS 문서를 보면 됩니다.
https://docs.microsoft.com/en-us/cpp/build/linking-an-executable-to-a-dll?view=msvc-170
WinPcap에도 관련 문서가 있었군요. 문서를
WinPcap에도 관련 문서가 있었군요. 문서를 봅시다, 문서를.
https://www.winpcap.org/docs/docs_412/html/group__wpcapsamps.html
댓글 달기