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
Related
I'm trying to figure out how to write a Linux PAM in Rust and I've started with this repo. When I compile it with --features libpam (which enables #[link(name="pam")] that imports external C functions), the compiler complains:
error: linking with `cc` failed: exit status: 1
...
note: /usr/bin/ld: cannot find -lpam: No such file or directory
Looking around SO, I've realized that the pam library was not found to be linked. However, I just cannot figure out how to either install it (I can find many libpam-something packages, but no libpam) or locate it such that I can indicate to the compiler/linker where to find it.
When I look into other crates that also work with PAM, they all import the C functions using #[link(name="pam")], and none specifies how to make it work.
I'm using Ubuntu 22.04.
The necessary headers for PAM library can be installed on Ubuntu as part of libpam0g-dev package (link for jammy):
sudo apt install libpam0g-dev
Debian package has the same name (so sudo apt-get install libpam0g-dev), CentOS uses pam-devel package for that (sudo yum install pam-devel).
Alternatively, on any platform you can use the source code from github and follow the installation instructions from README.
firstly, I google'd a lot but nothing I found related to my case, I have an ELF executable file I'm trying to run it in my Ubuntu WSL, I've changed the permissions (chmod +x file), when I run it, this error shows up
/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by myFile)
and when I use ld command this shows up to me
myFile(.eh_frame); no .eh_frame_hdr table will be created
and when I tried to upgrade GLIBC it says it's up-do-date
Reading package lists... Done
Building dependency tree
Reading state information... Done
libc6 is already the newest version (2.31-0ubuntu9.7).
libc6 set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 215 not upgraded.
and then I tried manually installing the deb file from https://packages.ubuntu.com/impish/amd64/libc6/download but this shows up to me :
dpkg: regarding libc6_2.34-0ubuntu3.2_amd64.deb containing libc6:amd64:
libc6:amd64 breaks fakeroot (<< 1.25.3-1.1ubuntu2~)
fakeroot (version 1.24-1) is present and installed.
dpkg: error processing archive libc6_2.34-0ubuntu3.2_amd64.deb (--install):
installing libc6:amd64 would break fakeroot, and
deconfiguration is not permitted (--auto-deconfigure might help)
Errors were encountered while processing:
libc6_2.34-0ubuntu3.2_amd64.deb
DISCLAIMER: I am not a linux professional, just found a way for my own problem with glibc not found error msg:
maybe you cannot use the binary since it was compiled with gcc-11 and your gcc version of your linux distribution and version only is gcc-9 and therefore only provides glibc_2.31 (I guess).
you can try to compile the program yourself from source. I had to do this with the new stockfish version 15, which also uses updated glibc_2.32/2.33/2.34 and my linux-mint does not provide that.
But compiling from source worked like a charm. Maybe this is an option for you.
I have some similar situation,
I copyed my executed file from a centos VM1 to another centos VM2,then I got the same question,I just copy the source code to VM2,and recompile it,then the question is solved.
I got a makefile and a shell script to compile it,so the compilation process is simple,update glibc may cause other problem and is more complicated,and i am a caiji,hope to help u
I've got this error with buildroot-2022.11 when executing make.
Ubuntu 20.04 - added this repo as described in the link
sudo apt update
sudo apt install libc6
It automatically installed 2.35 for me.
I am trying to install the MPI FFTW2 libraries (fftw2.1.5) as I need them for a program that only works with that version. The specific library I need is "drfftw_mpi.h" so I try the followed:
./configure --enable-mpi --enable-type-prefix
But it always gives me the following error:
configure: error: couldn't find mpi library for --enable-mpi
In a previous question they solve it by running sudo ldconfig before, but for me it does not work giving the same error. For other mpi software they solve it in this post by passing mpicc as the right compiler to ./configure, with the CC flag CC=mpicc, something that does not work for me.
I have installed Open MPI version 4.0.3 on a Ubuntu 20.04 LTS, and when --enable-mpi is not used I was able to install "dfftw.h" "drfftw.h" "fftw.h" and "rfftw.h", do you have an idea of what I am doing wrong or what should I do to install "drfftw_mpi.h"?
I am trying to compile VIM with native support for ruby and am using MinGW for that.
The compilation goes as expected until the make file tries to execute windres -DWIN32 -DWINVER=0x0400 -D_WIN32_WINNT=0x0400 ..... vim.rc gobj/vimres.res
This step failes with a windres: unexpected version string length 68 != 32 + 8. I am at a complete loss what kind of error this is and how I am supposed to fix it.
As far as I can see I downloaded the newest version of both the vim sources and MinGW environment.
Searching the internet hinted me at trying to do a mingw-get install --reinstall binutils=2.22-1 which I did. But I still get the same error message.
It seems that the
mingw-get install --reinstall binutils=2.22-1
did not actually install a previous version.
Instead, with
mingw-get remove binutils
mingw-get install binutils=2.22-1
I was able to install the previous version. Now, the windres step works.
I just compiled Vim with MinGW/MSYS and among others dynamic ruby support. Check out this gist for a guide through the process with gvim74.exe installation file as output.
I'm trying to compile a small game I made with SFML but whenever I do I get this error:
/usr/local/include/SFML/Window/OpenGL.hpp:48:24: fatal error: GL/glu.h: No such file or directory
Naturally, my first thought was I forgot to install opengl libraries, but when I yum install mesa-libGLU, I get this:
Package mesa-libGLU-7.11-0.11.20110525.0.fc15.x86_64 already installed and latest version
So I'm not sure what to do next.
Since it's a header you're missing, try installing the -devel version of that RPM.
mesa-libGLU-devel-7.11-0.11.20110525.0.fc15.x86_64