Trouble compiling pcap application

Hi All. I'm new to this forum but a long-time developer. This post may also be in the wrong group, my apologies if so.

I'm having trouble building my C++ pcap application because I cannot work out which package has the pcap include files, specifically /usr/include/pcap/pcap.h and friends.

My assumption is that I should be able to build on a standard Openwrt once I've install gcc and libpcap1. Is this assumption correct or do I have to set up a special install/build environment?

I searched long and hard for a libpcap-dev or similar, but no joy. I also tried building the pcap library via a download from tcpdump.org - but ./configure fails due to not liking the installed flex/lex. Ho hum.

Can someone hit me over the head with a clue stick please? Is my assumption about being able to compile my app on a standard OpenWrt+packages incorrect?

FWIW. The platform is a current OpenWrt running in an x86_64 VM which I've set up solely for development purposes.

OpenWrt is designed to be as small as possible. So there are no packages containing header files.
If you want to compile for OpenWrt, you'll have to setup an OpenWrt build environment.
See here.

2 Likes

Ahh. ok. Thanks for that. Is there a prefer platform? I was thinking Debian. I note that there is some talk around self-hosting but that seems experimental at this stage.

Debian should work, a lot of users are using Ubuntu 24.04 LTS (switch to 26.04 will probably happen after the next point release in September)

Script for all popular distros are available to setup your build environment

I personally use Ubuntu but that is just me

1 Like