views:

41

answers:

1

I built my qt app so that all the Qt modules it uses are contained in the same directory as the executable. It works on the machine I used to build the app and I made sure to test this by removing those shared libraries everywhere except in the current directory of the app. Doing a ldd shows that its looking for those libraries in the current directory and putting the executable by itself fails to open the exectuable. So this is all good but when I transfer this directory to a host machine it still cant find those libraries. what could be the problem?

+2  A: 

Is "." in the LD_LIBRARY_PATH on the 2nd machine?
Do you have the correct permissions on the library files?

Martin Beckett
that did the trick thanks :D
yan bellavance
Is there a way for me to set this path automatically without user intervention ie whenever the user starts the program from the desktop or a command lined, the LD_LIBRARY_PATH is modified. I want the user to be able to install the program by simply copying the directory wherever he wants and without modifyin his login script and whatnot.
yan bellavance
Not done much app deployment on Unix, you need to make sure that "." is at least on the exec path. Might be worth looking at making a proper RPM/DEB to put the .so in the system rather than messing about with the user editing paths
Martin Beckett
@yan bellavance: You could make a script with your app name, which adds the local path to the LD_LIBRARY_PATH, then calls your real application. Not the best way of doing things, but a fairly simple workaround.
Caleb Huitt - cjhuitt