0

So I build a simple C program with -libconfig and -L /usr/lib64/

something like: clang *.c -o app -L /usr/lib64/ -lconfig

I'm using centos6 and got the library here /usr/lib64/libconfig.so.8

It builds all fine but when I run it I get this: error while loading shared libraries: libconfig.so.9: cannot open shared object file: No such file or directory

Obviously it looks for a greater version of the library but I can't explain why. Just installing/upgrading libconfig.so.9 is also not an option.

Update

I took the advice from the comments and removed the unnecessary -L parameter but that didn't change anything. I still get the same error.
$ ll -s /usr/lib64/libconf* 0 lrwxrwxrwx. 1 root root 18 Dec 15 2015 /usr/lib64/libconfig.so -> libconfig.so.8.0.0 0 lrwxrwxrwx. 1 root root 20 Dec 15 2015 /usr/lib64/libconfig++.so -> libconfig++.so.8.0.0 0 lrwxrwxrwx. 1 root root 18 Dec 15 2015 /usr/lib64/libconfig.so.8 -> libconfig.so.8.0.0 0 lrwxrwxrwx. 1 root root 20 Dec 15 2015 /usr/lib64/libconfig++.so.8 -> libconfig++.so.8.0.0 44 -rwxr-xr-x. 1 root root 41960 Aug 19 2010 /usr/lib64/libconfig.so.8.0.0 88 -rwxr-xr-x. 1 root root 87408 Aug 19 2010 /usr/lib64/libconfig++.so.8.0.0

ldconfig -v | grep libconfig libconfig.so.8 -> libconfig.so.8.0.0 libconfig++.so.8 -> libconfig++.so.8.0.0

These lines look very ordinary and OK to me. Still no clue.

Semo
  • 111
  • 1
  • 10
  • What are you providing a library search path at all? `/usr/lib64` should be in the default search path. You cannot just mix different library versions or those compiled with different versions of libc either. If you got `libconfig.so.8` built with something other than (or for) your centos6, then it will likely not work. Also look at your error `libconfig.so.9`?? There has been a *soname* version bump in between the time you got parts of your system and whatever library you are attempting to use. (You should not just symlink it either -- there are reasons for the version change) – David C. Rankin Nov 20 '17 at 05:57
  • Try without the library path, and if the problem subsists try `ldconfig -v | grep libconfig`. Maybe `ls -l /usr/lib64/libconfig.so.8` would show that this is actually a symlink... – Déjà vu Nov 20 '17 at 06:06

0 Answers0