When I include "stdio.h" and try to use "printf" it works fine. In the same way when I use "krb5.h", its function "krb5_get_init_creds_password" does not get resolved by its own.
Error faced :
bash-4.1$ gcc krb.c
krb.c: In function ‘main’:
krb.c:6: warning: incompatible implicit declaration of built-in function ‘printf’
/tmp/ccTK4DJM.o: In function main':
krb.c:(.text+0x53): undefined reference to
krb5_get_init_creds_password'
collect2: ld returned 1 exit status
I had to compile using -lkrb5 which resolved the issue.
Can someone let me know why do I need to use gcc option "-lkrb5" to get that krb5 function resolved ? I am using C.