How to set Lib(.so) path in such a way that exe should search for libs from the same folder where it is present?
-
Hi guys
I have written a code which needs some .so libs.
My code is working perfectly on QT creator but when I am trying to run the same using the exe generated and required libs it is throwing this errorerror while loading shared labraries: libAECOSLib.so: cannot open shared object file: No such file or directory
I tried couple of things like :
QMAKE_LFLAGS += "-W1, -rpath,$$ORIGIN" in my pro file.
but it is throwing error unrecognized command '-W1', '-rpath'I have included libs in this way :
unix:!mac: LIBS += -L./IMI_Libraries/ -lARCOSLibwhen I am setting the path using terminal it is working
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/path to IMI Libraries
But I want that it should be handled through pro file.
How can I Solve this problem?
Thanks
Ashish -
@ashajg said in How to set Lib(.so) path in such a way that exe should search for libs from the same folder where it is present?:
How can I Solve this problem?
You can write a shell script where you set LD_LIBRARY_PATH and then call your executable. Then use that script to start your app.
-
Hi @jsulm
Thanks for the help !!!Is there any solution if I want to set this path in .pro file itself. I mean how can I make my executable to search for libs in the same folder by adding some paths in .pro file so that I can just run my executable on any system without using shell script or without setting LD_LIBRARY_PATH in terminal.
-