LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   What is this error cannot find -lelf (https://www.linuxquestions.org/questions/linux-newbie-8/what-is-this-error-cannot-find-lelf-4175499565/)

jyunker 03-26-2014 01:28 PM

What is this error cannot find -lelf
 
I am trying to compile aide. The commands are ./configure,make, make install.

I get two errors on the make command and never make it to the make install command.

Code:

gcc -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS -W -Wall -g -g -O2  -static  -o aide aide.o base64.o be.o commandconf.o compare_db.o conf_lex.o conf_yacc.o db.o db_disk.o db_file.o db_lex.o db_list.o db_sql.o do_md.o error.o gen_list.o getopt1.o getopt.o gnu_regex.o list.o md.o snprintf.o symboltable.o util.o  -lm      -lelf
/usr/bin/ld: cannot find -lelf
collect2: ld returned 1 exit status
make[3]: *** [aide] Error 1
make[3]: Leaving directory `/home/james/Desktop/aide-0.15.1/src'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/james/Desktop/aide-0.15.1/src'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/james/Desktop/aide-0.15.1'
make: *** [all] Error 2

The firt error is the one that I am concerned about. I beleive the second error will do way once I take care of the first error.


The error is

Code:

cc -D_GNU_SOURCE -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS -W -Wall -g -g -O2  -static  -o aide aide.o base64.o be.o commandconf.o compare_db.o conf_lex.o conf_yacc.o db.o db_disk.o db_file.o db_lex.o db_list.o db_sql.o do_md.o error.o gen_list.o getopt1.o getopt.o gnu_regex.o list.o md.o snprintf.o symboltable.o util.o  -lm      -lelf
/usr/bin/ld: cannot find -lelf
collect2: ld returned 1 exit status
make[3]: *** [aide] Error 1


It is not finding -lelf.

ld returned 1 exit status


I am not sure how to make it find lelf.

Any help appreciated.


Thanks in advance.


R,


jyunker

smallpond 03-26-2014 01:45 PM

I think you have a tab instead of a space in your command line right before calling out the library elf

knudfl 03-26-2014 02:04 PM

"lelf" = libelf.so

* How to decide a package providing libelf.so : $ yum provides */libelf.so
Install the package : # yum install elfutils-libelf-devel

Installing `aide-0.14.3' : # yum install aide

-

jyunker 03-26-2014 02:16 PM

explain please
 
I am not sure what you are saying:


Code:

I think you have a tab instead of a space in your command line right before calling out the library elf
Any help appreciated.


R,

jyunker

jyunker 03-26-2014 02:25 PM

The package in question is already installed.

Code:

[root@james sysconfig]# sudo yum install elfutils-libelf-devel-0.152-1.el6.x86_64
Loaded plugins: downloadonly, fastestmirror, priorities, refresh-packagekit, security
Loading mirror speeds from cached hostfile
 * base: mirror-centos.hostingswift.com
 * elrepo: ftp.cc.uoc.gr
 * epel: mirror.nexcess.net
 * extras: mirror-centos.hostingswift.com
 * rpmforge: mirror.nexcess.net
 * updates: mirror.5ninesolutions.com
Setting up Install Process
Package elfutils-libelf-devel-0.152-1.el6.x86_64 already installed and latest version
Nothing to do
[root@james sysconfig]# sudo yum install elfutils-libelf-devel
Loaded plugins: downloadonly, fastestmirror, priorities, refresh-packagekit, security
Loading mirror speeds from cached hostfile
 * base: mirror-centos.hostingswift.com
 * elrepo: ftp.cc.uoc.gr
 * epel: mirror.nexcess.net
 * extras: mirror-centos.hostingswift.com
 * rpmforge: mirror.nexcess.net
 * updates: mirror.5ninesolutions.com
Setting up Install Process
Package elfutils-libelf-devel-0.152-1.el6.x86_64 already installed and latest version
Nothing to do

And libelf.so is in LD_LIBARY_PATH.

So it should be finding it.


Also why did you type :

yum provides */libelf.so


instead of


yum provides libelf.so

?

Thanks in advance.

R,

jyunker

smallpond 03-26-2014 04:20 PM

Quote:

Originally Posted by jyunker (Post 5141757)
I am not sure what you are saying:


Code:

I think you have a tab instead of a space in your command line right before calling out the library elf
Any help appreciated.


R,

jyunker

The error you are getting indicates that the failing command is looking for a file named "-lelf" when it should be seeing the "-l" option to look for a library whose base name is "elf". Note the gap in your post between "-lm" and "-lelf". It looks like an error in the whitespace to me. Could be a line-wrap problem also.


All times are GMT -5. The time now is 02:20 PM.