Red Hat Bugzilla – Bug 82418
Cannot Statically Link Against librpm
Last modified: 2007-04-18 12:50:12 EDT
Description of problem:
When using libtool and automake to link the RPM 4.1 libraries, full static
linkage is not possible.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
In Makefile.am use:
program_LDADD = -lrpm
program_LDFLAGS = -all-static
Compiling this program produces the following error:
/usr/bin/ld: cannot find -lrpmdb-4.1
collect2: ld returned 1 exit status
This occurs because there is indeed no static version of librpmdb-4.1. There is
a shared version, but not static version. Since /usr/lib/librpm.la depends on
librpmdb-4.1, there should be static versions of these libraries.
No linkage statically against rpm.
Static link to rpm libraries.
It should be possible to statically link against librpm.
Use -lrpmdb, not -lrpmdb-4.1.