Description of Problem: kadm5 headers can not be used (without dirty hacks) in C++ programs: How Reproducible: $ cat test.c #include <kadm5/admin.h> int main() { kadm5_init(0,0,0,0,0,0,0); } Steps to Reproduce: 1. gcc -I/usr/kerberos/include -L/usr/kerberos/lib -lkadm5srv test.c # C test case 2. g++ -I/usr/kerberos/include -L/usr/kerberos/lib -lkadm5srv test.c # C++ test case 3. Actual Results: 1. succeeds 2. /tmp/ccoJWP5E.o: In function `main': /tmp/ccoJWP5E.o(.text+0x18): undefined reference to `kadm5_init(char *, char *, char *, _kadm5_config_params *, unsigned int, unsigned int, void **)' collect2: ld returned 1 exit status Expected Results: 2. succeeds also Additional Information: $ rpm -q krb5-devel gcc krb5-devel-1.2.2-4 gcc-2.96-85 Bug was reported to the maintainers (http://diswww.mit.edu:8008/menelaus.mit.edu/krb5-bugs/3213) also.
The header file is not actually meant for use outside of the Kerberos source tree itself. We install the kadm5 headers to get some way of programmatically manipulating the Kerberos database, but this practice is not the preferred one, and we're looking at alternative methods. I suggest including the header in an extern "C" block, which appears to be sufficient to compile your sample program with g++ on my test machine.