Evidently "the current folder" isn't in the run time search path used by your executable. I'm assuming that you are on linux (linux-gate.so.1
).
You need to ensure that "the current" directory is under the search path. You can do this at link time by using the -rpath
option to the linker (-R
is also accepted) or -Wl,-rpath,<dir>
if you are invoking the linker through the compiler front end. This embeds a search path to be used at run time into your program.
Consider how you want the program to be installed, though. There's no point in adding a path that is specific to your development environment. You might want to consider using $ORIGIN
or a $ORIGIN
relative path which tells the run time linker to look for shared objects in the location containing (or relative to) the executable. You should always avoid adding .
to the run time search path; your program shouldn't behave differently depending on the current directory of the process which invokes it.
As a temporary measure you can set the environment variable LD_LIBRARY_PATH
to override the embedded and system search paths but it is normally a bad idea to rely on LD_LIBRARY_PATH
overrides for a final installation.