[CentOS] How to compile APUE code on centos 6.X

Jonathan Billings billings at negate.org
Thu Jul 31 00:40:05 UTC 2014


On Thu, Jul 31, 2014 at 08:09:52AM +0800, Theodore Si wrote:
> I build it myself, not using rpm since it doesn't work. My OS is 32bit.

It works for me with libbsd and libbsd-devel installed:

$ cd /tmp
$ wget http://www.apuebook.com/src.3e.tar.gz
$ tar zxvf src.3e.tar.gz
$ cd apue.3e
$ make
[multiple lines building]
$ cd threads
$ make
gcc -ansi -I../include -Wall -DLINUX -D_GNU_SOURCE  barrier.c -o
barrier  -L../lib -lapue -pthread -lrt -lbsd
/tmp/ccmCvcBh.o: In function `thr_fn':
barrier.c:(.text+0x80): undefined reference to `heapsort'
collect2: ld returned 1 exit status
make: *** [barrier] Error 1
$ sudo yum -y -q install libbsd libbsd-devel
$ make
gcc -ansi -I../include -Wall -DLINUX -D_GNU_SOURCE  barrier.c -o
barrier  -L../lib -lapue -pthread -lrt -lbsd
$

I'll admit that my OS is 64-bit, but I don't see anything in the code
that would break with 32-bit.


-- 
Jonathan Billings <billings at negate.org>



More information about the CentOS mailing list