Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am currently trying to compile net-snmp-5.7.2 on rhel 6 64bit system. ./configure ends correctly, but when I do the make step I got the following error:

gcc  -shared -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic   agent.o  -o ../blib/arch/auto/NetSNMP/agent/agent.so  \
           -L/applis/src/compilation/net-snmp-5.7.2/perl/agent/../../snmplib/.libs -L/applis/src/compilation/net-snmp-5.7.2/perl/age nt/../../snmplib -L/applis/src/compilation/net-snmp-5.7.2/perl/agent/../../agent -lnetsnmpmibs -lnetsnmpagent -lnetsnmp         \

/usr/bin/ld: cannot find -lnetsnmpmibs

I'm a bit lost here, as I though that those libs should be provided by the net-snmp-5.7.2.

Can anyone give me some tips?

share|improve this question

closed as off-topic by Braiam, jimmij, Anthon, slm Nov 17 '14 at 23:00

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions describing a problem that can't be reproduced and seemingly went away on its own (or went away when a typo was fixed) are off-topic as they are unlikely to help future readers." – Braiam, jimmij, Anthon, slm
If this question can be reworded to fit the rules in the help center, please edit the question.

Isn't this available in the official repositories? Don't worry if the version looks old and candidate for the CVE winner of all time, Red Hat does keep up with security (and other) fixes backporting stuff so the base version doesn't need to be changed. A rpm -q --changelog <package> should make this clear. – vonbrand Mar 25 '13 at 11:02

You don't have the libnetsnmpibs library,

See the output from ld: /usr/bin/ld: cannot find -lnetsnmpmibs

share|improve this answer

You are missing prerequisites for the build. Go over the INSTALL or README file listing dependencies, and install all of them. You'll probably need the -devel packages of any libraries mentioned; the plain packages just contain what is needed to use them, not to build programs using them.

share|improve this answer
Hello, I was missing net-snmp-devel.x86_64 package, but this doesn't explain how I could build this depencies my self. My aim is to not be depandent from the rpm packages. – Hugo Mar 25 '13 at 12:57
@Hugo, what are you doing on RHEL then? It's biggest advantage is precisely that they handle the tracking upstream, integrating, troubleshooting, and packaging for you, and offer a solid, tested system. If you really want to go that route, learn how to build RPMs, check out the source RPMs for the relevant packages and adjust them for your versions. – vonbrand Mar 26 '14 at 9:37
I don't use rpm as I need to build software in order to use them in a chroot. – Hugo Mar 27 '14 at 10:24

The actual error, and moderately annoying part, is that the library requested / not found, WAS JUST COMPILED, and then fails to link itself.

The library actually exists in a different directory than is enumerated by the scripts that configured the build.

They havent fixed it in either:

During compilation, the following command is run:

LD_RUN_PATH="/usr/local/lib:/usr/local/lib/perl5/5.8.8/x86_64-linux/CORE" cc  -shared -L/usr/lib64 -L/lib64 -L/usr/local/ssl/lib agent.o  -o ../blib/arch/auto/NetSNMP/agent/agent.so   \
       -L/usr/local/lib -L/root/net-snmp- -L/root/net-snmp- -L/root/net-snmp- -lnetsnmpmibs -lnetsnmpagent -lnetsnmp    \

/usr/bin/ld: cannot find -lnetsnmpmibs


root@server [~/net-snmp-]# find ./ -iname 'libnetsnmpmibs.so*'

./agent/.libs/ is not part of the -L searchpath above; uncertain as to why. Speculation is that there is an outdated or improperly used Libtool...

That said, I too am installing this on a CentOS host. Why? Because the CentOS box is stuck on some old Centos5 revision, and the SNMPD codebase it uses TIMES OUT during heavy load causing MANY spurious alerts when nothing is actually wrong.

I don't care that CentOS has been updating the ancient version for security bugs, this is a performance enhancemenet / usability fix / feature improvement that they haven't applied to any newer releases of horrendously old

share|improve this answer
This looks more like an extended comment than an answer. Maybe you could rewrite it to address the problem described in the original question? – Sami Laine Jul 27 '14 at 11:40
I don't see how this addresses the question at all - you're having the same issue on a different OS, but I don't see anything in your post that indicates a solution. Please take the tour, this isn't a usual forum. If there is a solution in there somewhere, please make it stand out by editing your post. – Mat Jul 27 '14 at 12:05

The install section mentions that if you want the perl modules, to compile and install the base first, then rerun the perl subdir,

If you wish to build the perl modules by hand, install Net-SNMP first and then change directories to the perl subdirectory and:


cd perl
perl Makefile.PL
make test
make install

(The last instruction should be run as-root); that might be worth trying?

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.