How to compile packetbeat from source on a linux distribution where the libpcap library is installed in the custom location

Hi, I'm trying to build packet-beat from source following the guide here. I'm using a 64bit linux distribution where the libpcap library is installed in a different location than its default path i.e /usr/local/lib. How to compile packet-beat using this libpcap ?

You need to set the include path using CFLAGS. You can modify the source file to add your custom include path or you can use an env var to pass the info to the compiler.

export CGO_CFLAGS="-I/my/custom/path"

See https://golang.org/cmd/cgo/ for more info about CFLAGS and Go.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.