On my Raspberry Pi, with Debian Squeeze, I want to link to the shared objects in /opt/vc/lib. I have added this directory to a file in /etc/ld.so.conf.d/ which is included in /etc/ld.so.conf. The compiler/linker runs without error, but upon execution, the program complains about missing .so files. Running ldd confirms that the libs cannot be found, but running ldconfig -v, after running ldconfig, shows the libs are in the cache.

What can cause this problem?


Another thing that could cause this issue is an RPATH set in the executable - see wikipedia.

  • Did you run sudo ldconfig? Are the libs/dir listed in output from ldconfig -v? The linker and loader are two different things (ldd vs ld).
    – XTL
    Nov 26, 2012 at 6:30
  • 1
    Yes I have checked both of these things. Dec 11, 2012 at 14:33
  • What exactly is the message about .so files?
    – XTL
    Dec 12, 2012 at 7:26
  • Are you actually passing the correct linker flags to gcc? Mar 14, 2013 at 22:57
  • Are you trying to access the share object using dlopen ? In that case, the presence of the .so file will not be checked at compile time. Please post the complete compilation command that you are running.
    – Jay
    Nov 10, 2013 at 14:33

2 Answers 2


Try appending your path to the LD_LIBRARY_PATH variable and re-compiling. The only other thing i know would be to create links to your libraries in one of the standard library locations.

  • I have actually already tried both of these things already, without success. Nov 29, 2012 at 14:32
  • I'm accepting this answer as I've reformatted my pi since this question was asked, and it has useful information in it Jun 16, 2015 at 12:25

to make linking work you'll need to run ldconfig

$ sudo ldconfig

(oh well already in comments above. didn't see that until post)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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