Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
09-06-2014, 04:28 AM
|
#1
|
LQ Newbie
Registered: Jul 2014
Posts: 13
Rep: 
|
NET-SNMP make fails
I am using Ubuntu 14.04. I have downloaded the net-snmp package net-snmp-5.7.3.pre5. The configure went well. Make gives the following error :
/usr/bin/ld: /usr/local/lib/perl5/5.18.2/x86_64-linux/CORE/libperl.a(op.o): relocation R_X86_64_32S against `PL_sv_yes' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/perl5/5.18.2/x86_64-linux/CORE/libperl.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
make[1]: *** [libnetsnmpagent.la] Error 1
make[1]: Leaving directory `/home/dell/Desktop/net-snmp-5.7.3.pre5/agent'
make: *** [subdirs] Error 1
Any solutions?
Thanks
|
|
|
09-06-2014, 04:32 AM
|
#2
|
LQ Guru
Registered: Dec 2008
Location: Westgate-on-Sea, Kent, UK
Distribution: Debian Testing Amd64
Posts: 5,465
Rep: 
|
Have you tried doing this as they suggest?
jdk
|
|
|
09-06-2014, 06:40 AM
|
#3
|
LQ Newbie
Registered: Jul 2014
Posts: 13
Original Poster
Rep: 
|
Yes i tried recompiling with fPIC : ./configure --with-cflags=fPIC.
It gave the following error :
Location to write persistent information (/var/net-snmp):
setting Location to write persistent information to... /var/net-snmp
checking if I need to feed myself to ksh... no
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for grep that handles long lines and -e... (cached) /bin/grep
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln -s works... yes
checking whether make sets $(MAKE)... yes
checking for a sed that does not truncate output... /bin/sed
checking for file... file
checking for find... find
checking for whoami... whoami
checking for autoconf... no
checking for autoheader... no
checking for perl... /usr/local/bin/perl
checking for ps... /bin/ps
checking for python... /usr/bin/python
checking for uname... /bin/uname
checking whether the Perl function system() invokes a POSIX shell... yes
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/home/dell/Desktop/net-snmp-5.7.3.pre5':
configure: error: C compiler cannot create executables
|
|
|
09-06-2014, 06:54 AM
|
#4
|
LQ Newbie
Registered: Jul 2014
Posts: 13
Original Poster
Rep: 
|
im sorry... the make was run as
make CFLAGS=-fPIC
it ran till it gave this :
libtool: compile: gcc -I../include -I. -I../agent -I../agent/mibgroup -I../snmplib -I/usr/local/ssl/include -fPIC -c snmp_perl.c -fPIC -DPIC -o .libs/snmp_perl.o
snmp_perl.c:5:20: fatal error: EXTERN.h: No such file or directory
#include <EXTERN.h>
^
compilation terminated.
make[1]: *** [snmp_perl.lo] Error 1
make[1]: Leaving directory `/home/dell/Desktop/net-snmp-5.7.3.pre5/agent'
make: *** [subdirs] Error 1
|
|
|
09-06-2014, 09:23 AM
|
#5
|
LQ Guru
Registered: Dec 2008
Location: Westgate-on-Sea, Kent, UK
Distribution: Debian Testing Amd64
Posts: 5,465
Rep: 
|
Have you installed the perl package? That's the package that seems to provide EXTERN.h all in caps.
jdk
Last edited by jdkaye; 09-06-2014 at 09:32 AM.
|
|
|
09-06-2014, 11:48 AM
|
#6
|
LQ Newbie
Registered: Jul 2014
Posts: 13
Original Poster
Rep: 
|
i have installed perl 5.18.2.
i moved all header files to include directory in net-snmp. it still gives the error.
/usr/bin/ld: /usr/local/lib/perl5/5.18.2/x86_64-linux/CORE/libperl.a(op.o): relocation R_X86_64_32S against `PL_sv_yes' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/perl5/5.18.2/x86_64-linux/CORE/libperl.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
make[1]: *** [libnetsnmpagent.la] Error 1
make[1]: Leaving directory `/home/dell/Desktop/net-snmp-5.7.2/agent'
make: *** [subdirs] Error 1
|
|
|
09-06-2014, 12:22 PM
|
#7
|
LQ Guru
Registered: Dec 2008
Location: Westgate-on-Sea, Kent, UK
Distribution: Debian Testing Amd64
Posts: 5,465
Rep: 
|
Quote:
Originally Posted by dharm_sk
i have installed perl 5.18.2.
i moved all header files to include directory in net-snmp. it still gives the error.
|
But it gives a different error. It is no longer complaining about EXTERN.h Are you still compiling using the -fPIC switch?
jdk
|
|
|
09-06-2014, 01:21 PM
|
#8
|
LQ Newbie
Registered: Jul 2014
Posts: 13
Original Poster
Rep: 
|
Its working fine now. I recompiled perl5.18.2 package as below
./Configure -de -Dprefix=/usr/local -Dusethreads -Duseshrplib, make , make install
referred the following link : http://sourceforge.net/p/net-snmp/ma...sage/24080522/
And then compiled net-snmp package as ./configure , make CFLAGS=-fPIC, make install went well.
Thank You jdkaye.
Last edited by dharm_sk; 09-06-2014 at 01:23 PM.
|
|
|
09-07-2014, 12:04 AM
|
#9
|
LQ Guru
Registered: Dec 2008
Location: Westgate-on-Sea, Kent, UK
Distribution: Debian Testing Amd64
Posts: 5,465
Rep: 
|
I'm glad your problem is solved and pleased to have been of service. Have fun!
jdk
|
|
|
11-18-2015, 07:52 AM
|
#10
|
LQ Newbie
Registered: Nov 2015
Posts: 1
Rep: 
|
Hello dharm_sk,
I'm following this thread cause i'm getting the exact same issues. I'm hoping you didn't forget what you did to solve the problem...
I'm stuck at "i moved all header files to include directory in net-snmp" . What header files are you talking about, and where did you put them ?
Thanks in advance
-- EDIT
Ok i had read "include" as a verb, and not as THE "include" directory in net-snmp, makes much more sense now. So i guess the header files you're talking about are the ones in the perl_5.18.2 folder ?
-- EDIT #2
Ok guys i spent all afternoon trying to fix this, i really don't get it.
When i follow post #8, i get (at the "make CFLAGS=-fPIC" step for net-snmp, without moving the perl h files to net-snmp/include) :
libtool: compile: gcc -I../include -I. -I../agent -I../agent/mibgroup -I../snmplib -I/usr/local/ssl/include -fPIC -c snmp_perl.c -fPIC -DPIC -o .libs/snmp_perl.o
snmp_perl.c:5:20: fatal error: EXTERN.h: No such file or directory
#include <EXTERN.h>
^
compilation terminated.
make[1]: *** [snmp_perl.lo] Error 1
make[1]: Leaving directory `/home/dell/Desktop/net-snmp-5.7.3.pre5/agent'
make: *** [subdirs] Error 1
And when i DO put these files in net-snmp/include, i still get:
/usr/bin/ld: /usr/local/lib/perl5/5.18.2/x86_64-linux/CORE/libperl.a(op.o): relocation R_X86_64_32S against `PL_sv_yes' can not be used when making a shared object; recompile with -fPIC
/usr/local/lib/perl5/5.18.2/x86_64-linux/CORE/libperl.a: error adding symbols: Bad value
collect2: error: ld returned 1 exit status
make[1]: *** [libnetsnmpagent.la] Error 1
make[1]: Leaving directory `/home/dell/Desktop/net-snmp-5.7.2/agent'
make: *** [subdirs] Error 1
I don't know what i'm missing. My perl version is same as yours, though my net-snmp is 5.5.1, could that be what's making it go wrong ?
Last edited by idontlikeusernames; 11-18-2015 at 11:05 AM.
|
|
|
11-18-2015, 09:06 PM
|
#11
|
LQ Guru
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.x
Posts: 18,434
|
@idontlikeusernames: this thread finished over a year ago. Please start a new one
|
|
|
All times are GMT -5. The time now is 11:03 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|