OpenLDAP & Howes/Smith Programming LDAP book...

Hello,
I just completed installing the OpenLDAP kit. Went over the Quick Guide
and everything seems to be working fine.
My next step was to learn how to program using the LDAP API, so I went
out and purchased Howes/Smith book, "LDAP, Programming Directory-Enabled
Applications with Lightweight Directory Access Protocol", from Macmillan
Technical Publishing.
I typed in one of the sample programs on Ch2, but when I try to compile
it I'm getting all kinds of errors on ldap.h. I discovered that if I
switch the order of the header files I get less errors. My current
order is:
#include <portable.h>
#include <lber.h>
#include <ldap.h>
#include <stdio.h>
My list of errors is finally down to 5, which are:
undefined reference to 'ldap_init'
undefined reference to 'ldap_simple_bind_s'
undefined reference to 'ldap_perror'
undefined reference to 'ldap_unbind'
undefined reference to 'ldap_unbind'
...I'm currently looking at the header files to see what's wrong. I'm
working on a RedHat Linux 5.2 box with the cc compiler.
Anyone has any clues?
Thanks,
MCruz