Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

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).

share|improve this answer
    
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 W. 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

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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