thedevilsjester
December 5th, 2005, 12:33 AM
In an attempt to keep my application self contained, I am putting all of its required libs in the applications install directory ( which is, usually, /opt/<appname>/system )
To force ld to look there I have to pass g++ the rpath flag like:
-Wl,--rpath,./system
And this is fine if they are in the programs directory when they run it, because ld will look in ./system for the files, however if they are in another directory and just typed in the full path, or if they clicked a link to the app, etc..., then ld will not find the libs (because the . 'current directory', is not the same as the apps directory.)
Basically my quesion is, is there another way to have ld dynamically look for the libs? Or another flag I can pass to have it use the apps directory, not the current directory? I would hate to force my app to be installed in a specific directory, simply because ld cant find the libs otherwise....
On a side note, although I appreciate any help and suggestions, please dont give me a lecture on dynamic libs and their purpose ;) I know that they should be installed into a public directory and not sit with the app itself, but this is a situation where that is not a good option.
To force ld to look there I have to pass g++ the rpath flag like:
-Wl,--rpath,./system
And this is fine if they are in the programs directory when they run it, because ld will look in ./system for the files, however if they are in another directory and just typed in the full path, or if they clicked a link to the app, etc..., then ld will not find the libs (because the . 'current directory', is not the same as the apps directory.)
Basically my quesion is, is there another way to have ld dynamically look for the libs? Or another flag I can pass to have it use the apps directory, not the current directory? I would hate to force my app to be installed in a specific directory, simply because ld cant find the libs otherwise....
On a side note, although I appreciate any help and suggestions, please dont give me a lecture on dynamic libs and their purpose ;) I know that they should be installed into a public directory and not sit with the app itself, but this is a situation where that is not a good option.