PcapPlusPlus: Can't get network device live from getPcapLiveDevicesList()

Hello @seladb I’m using Visual Studio 2022 on Windows 11 and Npcap 1.72. I can’t get any device from PcapLiveDeviceList class. I installed PcapPlusPlus using vcpkg with this command. vcpkg install pcapplusplus:x64-windows

this is my code

#include <PcapLiveDeviceList.h>

  for (auto device : pcpp::PcapLiveDeviceList::getInstance().getPcapLiveDevicesList()) {
    std::cout << device->getName() << std::endl;
    std::cout << device->getDesc() << std::endl;
  }

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 19 (11 by maintainers)

Most upvoted comments

Everything became perfectly assembled and executed when assembling according to this recipe:

Install MSYS2

Terminal MSYS2 MinGW64

pacman -Syu pacman -Su

pacman -S mingw-w64-clang-x86_64-toolchain

pacman -S mingw-w64-x86_64-gcc pacman -S mingw-w64-x86_64-cmake pacman -S make g++ --version cmake --version make --version pacman -S git git --version

cd /c/Libs/ git clone https://github.com/seladb/PcapPlusPlus.git

Install npcap-1.81.exe Take dir npcap-sdk-1.15 cd /c/Libs/PcapPlusPlus/ mkdir build cd build cmake -G “Unix Makefiles” -DPCAPPP_BUILD_EXAMPLES=OFF -DPCAPPP_BUILD_TESTS=OFF -DPCAPPP_BUILD_TUTORIALS=OFF -DPCAP_ROOT=/c/Libs/npcap-sdk-1.15 … make make install

Take dir C:\Libs\PcapPlusPlus\Examples\ExampleApp cd /c/Projects/ExampleApp/ mkdir build cd build cmake -G “Unix Makefiles” -DPcapPlusPlus_ROOT=/c/Libs/PcapPlusPlus -DPCAP_ROOT=/c/Libs/npcap-sdk-1.15 -DPacket_ROOT=/c/Libs/npcap-sdk-1.15 … make ./example-app.exe

You may close the issue. Thanks for the support

Thanks @kokose1234 , I’ll take a look in the next few days and keep you posted