0

QtCreator shows me this error message and asks me to browse for and select a cmake executable:

/usr/bin/cmake: error while loading shared libraries: libgssapi_krb5.so.2: cannot open shared object file: No such file or directory
David Foerster
  • 36,264
  • 56
  • 94
  • 147

1 Answers1

0

That error message actually suggests that it is able to find the cmake executable (as /usr/bin/cmake) but when it attempts to execute it it can't, because cmake requires a shared library (libgssapi_krb5.so.2) which can't be found.

There are a variety of ways that that might happen, but there are a couple of things you can try:

If the library is just not actually installed, you may need to install its package:

sudo apt-get install libgssapi-krb5-2

If the libgssapi-krb5-2 package is already installed, it's possible that there is just a problem with the libgssapi_krb5.so.2 symlink that links to the actual library. If this is the case, the following command should fix it:

sudo ldconfig -v

It may also be a good idea to make sure that there aren't any other libraries that are missing that cmake needs to run. You can do this with the following command:

ldd /usr/bin/cmake

This will print all of the shared libraries it needs, and where it found them in the filesystem (if it was able to find them, or tell you if it can't)

Foogod
  • 315
  • i try the 3 commands , when i try the third command he told me that libgssapi_krb5.so.2 not found ?? – Safaa Tharwat Nov 28 '15 at 23:38
  • Did the apt-get command tell you it was already at the newest version? If so, it sounds like the package installation may have gotten screwed up. Try sudo apt-get install --reinstall libgssapi-krb5-2 instead. – Foogod Nov 28 '15 at 23:46
  • yes ,so i reinstall it ,and when i use ldd /usr/bin/cmake it tells methat libkrb5.so.3 => not found libkrb5support.so.0 => not found – Safaa Tharwat Nov 29 '15 at 00:01
  • Ok, well that's progress :) It sounds like you may have several packages which need to be reinstalled. You can figure out which packages you need by going to http://packages.ubuntu.com/ then scroll down to "Search the contents of packages" and entering in the filename you're looking for. In this case, it tells me that libkrb5.so.3 is in the libkrb5-3 package, and libkrb5support.so.0 is in libkrb5support0. Try reinstalling those packages the same way and check ldd again (rinse and repeat as necessary) – Foogod Nov 29 '15 at 01:56