0

I'm trying to recompile my software for debian 8, but i have run into this strange issue of libgssappi refusing to link with anything.

>~/torque_github$ gcc test.c -lgssapi
/usr/bin/ld: cannot find -lgssapi
collect2: error: ld returned 1 exit status

The library is present in the system, as seen here:

>~/torque_github$ /sbin/ldconfig -p | grep gssapi
        libgssapi_krb5.so.2 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libgssapi_krb5.so.2
        libgssapi.so.3 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libgssapi.so.3
  • is that your whole gcc command? You need to tell gcc where the library is. There are a couple ways to do this, for example: gcc test.c -L/usr/lib/x86_64-linux-gnu -lgssapi – user1794469 Sep 7 '15 at 11:48
3

You probably need to install the development-package libkrb5-dev or krb5-multidev:

apt-get install libkrb5-dev

and need the correct parameters for gcc (run krb5-config.mit gssrpc --libs to get them):

gcc test.c -o test $(krb5-config.mit gssrpc --libs)

which expands to (depending on the system):

gcc test.c -o test -L/usr/lib/x86_64-linux-gnu/mit-krb5 -Wl,-z,relro -lgssrpc -lgssapi_krb5 -lkrb5 -lk5crypto -lcom_err
  • I ended up using pkg-config, but the correct path seemed to be the problem. – Let_Me_Be Sep 7 '15 at 12:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.