Tuesday, December 28, 2021

[SOLVED] /usr/bin/ld: cannot find -lauparse

Issue

How can I install the auparse library on Fedora 26?

$ gcc -lauparse me.c
/usr/bin/ld: cannot find -lauparse

I have tried many things, including these.

$ sudo find / -name *auparse.so
/usr/lib64/python3.6/site-packages/auparse.so
$ export LD_LIBRARY_PATH=/usr/lib64/python3.6/site-packages/
didnt help :{
sudo ln -s /usr/lib64/python3.6/site-packages/auparse.so /usr/lib/gcc/x86_64-redhat-linux/7/auparse.so
didnt help :{
$ pkg-config --libs auparse
Package auparse was not found in the pkg-config search path.

I'd really appreciate help.


Solution

You need audit-libs-devel. Here's how I found that:

$ sudo dnf install /usr/lib64/libauparse.so
Dependencies resolved.
================================================================================
 Package               Arch        Version           Repository            Size
================================================================================
Installing:
 audit-libs-devel      x86_64      2.7.7-1.fc26      updates-testing       81 k

In general:

  1. Libraries are gonna be in /usr/lib64 on x86_64 systems.
  2. -lsomething means to look for /usr/lib64/libsomething.so
  3. And DNF has this neat feature where it can find things by file, so there you go.
  4. Also, for most libraries on Fedora, there's a runtime package (here, audit-libs and then a devel package (audit-libs-devel) which contains the .so symlink and usually header files and stuff.


Answered By - mattdm