I'm new to using gcc and am trying to compile the search.c sample file and
I get messages like this:

search.c.text+0xc0): undefined reference to `ldap_set_option'

I'm really not familiar with the tools, though I have been using the Java
libraries on Windows for several years. I'm switching to SUSE for several
projects and would like to start using C/C++ to do more of my work. The
command I used and all of it's output are below. The machine is just a
standard SUSE 10 install with the development tools added. Any help would
be greatly appreciated.

-ac.

ac2:/opt/novell-cldap-devel-2007.02.16-1linux # gcc
-I/opt/novell-cldap-devel-2007.02.16-1linux/include
-L/opt/novell-cldap-devel-2007.02.16-1linux/lib search.c
/tmp/ccK3WWXH.o: In function `main':
search.c.text+0xc0): undefined reference to `ldap_set_option'
search.c.text+0xdb): undefined reference to `ldap_set_option'
search.c.text+0xed): undefined reference to `ldap_init'
search.c.text+0x133): undefined reference to `ldap_simple_bind_s'
search.c.text+0x147): undefined reference to `ldap_err2string'
search.c.text+0x162): undefined reference to `ldap_unbind_s'
search.c.text+0x1d2): undefined reference to `ldap_search_ext_s'
search.c.text+0x1e6): undefined reference to `ldap_err2string'
search.c.text+0x201): undefined reference to `ldap_msgfree'
search.c.text+0x20c): undefined reference to `ldap_unbind_s'
search.c.text+0x239): undefined reference to `ldap_sort_entries'
search.c.text+0x24b): undefined reference to `ldap_first_entry'
search.c.text+0x265): undefined reference to `ldap_get_dn'
search.c.text+0x28c): undefined reference to `ldap_memfree'
search.c.text+0x2a5): undefined reference to `ldap_first_attribute'
search.c.text+0x2c6): undefined reference to `ldap_get_values'
search.c.text+0x318): undefined reference to `ldap_value_free'
search.c.text+0x323): undefined reference to `ldap_memfree'
search.c.text+0x33c): undefined reference to `ldap_next_attribute'
search.c.text+0x35c): undefined reference to `ber_free'
search.c.text+0x36e): undefined reference to `ldap_next_entry'
search.c.text+0x38d): undefined reference to `ldap_count_entries'
search.c.text+0x3ae): undefined reference to `ldap_msgfree'
search.c.text+0x3b9): undefined reference to `ldap_unbind_s'
collect2: ld returned 1 exit status