Difference between revisions of "FAQ:Compiling 03"

From Net-SNMP Wiki
Jump to: navigation, search
 
(Latest FAQ revision - preparing for 5.5 release)
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
= #  On RedHat 8.0 or up I get "/usr/bin/ld: cannot find -lelf". Why? =  
+
= Why does the compilation complain about missing libraries? =  
  
A typical installation of RedHat 8.0 and up doesn't always include
+
{{FAQ:Compiling_03}}
the full set of <CODE>'libelf'</CODE> library links.  In order to build Net-SNMP
+
you may need to install the <CODE>'elfutils-devel'</CODE> RPM.
+
 
+
A alternative quick fix is to add the missing symbolic link, using:
+
 
+
    ln -s libelf.so.1 /usr/lib/libelf.so
+
 
+
(or whatever the correct library is on your system).
+
This is typically only needed when you've configured the agent to
+
include the Host Resources MIB support (<CODE>'--with-mib-modules=host'</CODE>).
+
  
 
     [[FAQ:Compiling]]
 
     [[FAQ:Compiling]]
 
     {{FAQ:Compiling}}
 
     {{FAQ:Compiling}}

Latest revision as of 16:06, 19 July 2009

Why does the compilation complain about missing libraries?

This has been seen in a number of guises over the years - most commonly on Linux systems (although the problem may also occur elsewhere). A typical installation may not always include the full set of library links required for building the Net-SNMP software.

This problem can usually be fixed by installing the missing packages (typically the development version of a package that is already there).

Examples of this that we have come across include:

    -lelf       elfutils-devel      (later renamed to elfutils-libelf-devel)
    -lbz2       bzip2-devel
    -lselinux   libselinux-devel
    -lcrypto    openssl/openssl-devel
    -lbeecrypt  libbeecrypt/beecrypt/beecrypt-devel.

These are the names of the RedHat/Fedora RPMs. Other distributions or O/S's may use different names, but the basic idea should be the same.

If the compilation is complaining about a missing .so file, then an alternative quick fix is to add the missing symbolic link, using something like:

         ln -s libelf.so.1 /usr/lib/libelf.so
 

giving the appropriate generic library name from the error message, and the correct number for whichever version of this library you have installed.

If the compilation is complaining about a .la file, then you should install the relevant development package, as listed above.

   FAQ:Compiling
   
  1. How do I control the environment used to compile the software?
  2. How do I control the environment used to compile the software under Windows?
  3. Why does the compilation complain about missing libraries?
  4. How can I reduce the memory footprint?
  5. How can I reduce the installation footprint or speed up compilation?
  6. How can I compile the project for use on an embedded system?
  7. How can I compile the project to use static linking?
  8. Why does 'make test' skip various tests?
  9. Why does 'make test' complain about a pid file?