简体   繁体   中英

Compiling Rust with pcap in Alma Linux

I'm trying to run a rust program that I've been using on Ubuntu on an AlmaLinux distro.

It utilizes the pcap crate, which is installed.

When I try to compile the application, I'm getting a

/user/bin/ld: cannot find -lpcap
    collect2: error: ld returned 1 exit status

My initial thought was that libpcap was not installed on this machine, but in fact, it is. I've uninstalled and reinstalled it just in case there was something wrong with the initial install.

Any ideas on what could be wrong?

You need to install pcap with lib and header, on AlmaLinux this mean devel package. You can use https://pkgs.org/search/?q=pcap to search what packet you need to install, on your case probably https://almalinux.pkgs.org/9/almalinux-crb-x86_64/libpcap-devel-1.10.0-4.el9.i686.rpm.html . This package require you activate CRB repository, see doc https://wiki.almalinux.org/repos/AlmaLinux.html .

dnf config-manager --set-enabled crb
dnf install libpcap-devel

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM