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 trying to do a build of rpm from source. I got through the ./configure and ran through a good chunk of make. Unfortunately I keeping getting stopped up on undefined references to bzerror, bzwrite, bzflush and others. Looking around online I see these functions are part of the bzip2 package. Ive installed the development libraries, but I am still getting this message. Can anyone assist me in resolving these dependencies? thanks...

make[2]: Entering directory `/mnt/fedRoot/rpm-4.6.1/lib'
make  all-am
make[3]: Entering directory `/mnt/fedRoot/rpm-4.6.1/lib'
/bin/sh ../libtool --tag=CC   --mode=link gcc -std=gnu99  -g -O2 -fPIC -DPIC -D_REENTRANT -Wall -Wpointer-arith -Wmissing-prototypes -Wno-char-subscripts  -fno-strict-aliasing -fstack-protector   -o rpmdb_archive  ../db3/db_archive.o ../db3/util_sig.o librpm.la -lrt -lpthread 
gcc -std=gnu99 -g -O2 -fPIC -DPIC -D_REENTRANT -Wall -Wpointer-arith -Wmissing-prototypes -Wno-char-subscripts -fno-strict-aliasing -fstack-protector -o .libs/rpmdb_archive ../db3/db_archive.o ../db3/util_sig.o  ./.libs/librpm.so /mnt/fedRoot/rpm-4.6.1/rpmio/.libs/librpmio.so -lmagic -lelf -llua -lm -lnss3 -lpopt -lrt -lpthread  -Wl,--rpath -Wl,/usr/local/lib

/mnt/fedRoot/rpm-4.6.1/rpmio/.libs/librpmio.so: undefined reference to `bzerror'
/mnt/fedRoot/rpm-4.6.1/rpmio/.libs/librpmio.so: undefined reference to `bzwrite'
/mnt/fedRoot/rpm-4.6.1/rpmio/.libs/librpmio.so: undefined reference to `bzflush'
/mnt/fedRoot/rpm-4.6.1/rpmio/.libs/librpmio.so: undefined reference to `bzdopen'
/mnt/fedRoot/rpm-4.6.1/rpmio/.libs/librpmio.so: undefined reference to `bzread'
/mnt/fedRoot/rpm-4.6.1/rpmio/.libs/librpmio.so: undefined reference to `bzclose'
/mnt/fedRoot/rpm-4.6.1/rpmio/.libs/librpmio.so: undefined reference to `bzopen'
collect2: ld returned 1 exit status
make[3]: *** [rpmdb_archive] Error 1
make[3]: Leaving directory `/mnt/fedRoot/rpm-4.6.1/lib'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/mnt/fedRoot/rpm-4.6.1/lib'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/mnt/fedRoot/rpm-4.6.1'
make: *** [all] Error 2
share|improve this question
up vote 2 down vote accepted

The libraries would have to be picked up by configure. If you ran configure, then installed the bzip2 development files, then re-ran configure, it may still have picked wrong information from its cache. Run make distclean, then ./configure again.

share|improve this answer
@Gilles... I definitely have not re-run configure. I will give this a go later today. Thank you for the information... I did notice that when I tried to re-run make, it seemed to pick from shortly before the area where I was getting the error. This tells me that there were some files created/compiled that it can keep track of. Do I need to get rid of those, or start over again from a fresh rpm folder when I re-run ./configure? – Hari Seldon Jun 16 '11 at 10:14
@Hari: Under usual conventions, make clean removes everything written by make, but leaves stuff written by configure; make distclean removes everything created by either make or configure. – Gilles Jun 16 '11 at 12:11
@Gilles ... Thanks for the info... off to the man pages for more :) – Hari Seldon Jun 16 '11 at 12:14
@Hari: This is a convention, it won't be in man pages. I think either the GNU make manual or the GNU coding standards describe these conventions (together with other less-widely followed conventions; make clean is pretty much universal, make distclean and its meaning with respect to configure is fairly common even outside GNU). – Gilles Jun 16 '11 at 12:30
@Gilles: There is so much to take in with linux in general. I will add the GNU make manual to my pile of reading. Im determined to make this work... – Hari Seldon Jun 16 '11 at 13:00

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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