I am very new to Linux and Ubuntu and I have ported my simple game engine to linux. The engine is in a .so file and is linked to the executable.

I am unable to run my executable because it says that it cannot find the Engine.so file (when run in terminal).

So if I am developing on Ubuntu how can I get the executable to find the library were ever it is?

Second question is when distributing the application how are the .so files installed? I assume they are not just put in the same directory as the exe as in windows? so how are they installed?


Executables search for libraries in a set of places, e.g. /lib, /usr/lib, /usr/local/lib,... so if you do not put your .so file in one of these places (/usr/local/lib might be a good place), the executable won't run.

You can explicitly specify a set directories to search for by setting an environment variable LD_LIBRARY_PATH containing whatever directories you like, (including your development directory for instance).

  • Thanks, When programs install so they put there needed libs in those folders for you? – David Colson Sep 2 '12 at 17:08
  • @DavidColson Typically when you build from source, and do ./configure make make --install (or whatever the command strings are for that make file), it has a script to automatically install to wherever it will check for the script(s) and libraries. Although there are programs which don't install themselves anywhere correctly. – Thomas Ward Sep 2 '12 at 17:10
  • Many third-party packages make use of the second mechanism so that they can supply the appropriate versions of the libraries with their installer. – Ignacio Vazquez-Abrams Sep 2 '12 at 17:41

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.