Try to deploy a Subdirs project in Linux.
-
wrote on 2 Jan 2022, 19:28 last edited by
Hello I'm trying to deploy an application in Linux, in Qt Creator I build in release mode and everything looks good. When I attempt to run the application from the terminal or from file manager it won't run. When I run from the terminal I get the message:
(executable file created in creator) error while loading shared libraries: (dependencies filename) cannot open shared object file: No such file or directory
when I run an ldd -d on my executable I can see the following:
lib from core location => not found
When I attempt to copy this to the same directory there is no effect, and when I attempt to point to the dependencies location I can't seem to change the not found error. Assistance on how to point to the dependencies' location is greatly appreciated. -
Hello I'm trying to deploy an application in Linux, in Qt Creator I build in release mode and everything looks good. When I attempt to run the application from the terminal or from file manager it won't run. When I run from the terminal I get the message:
(executable file created in creator) error while loading shared libraries: (dependencies filename) cannot open shared object file: No such file or directory
when I run an ldd -d on my executable I can see the following:
lib from core location => not found
When I attempt to copy this to the same directory there is no effect, and when I attempt to point to the dependencies location I can't seem to change the not found error. Assistance on how to point to the dependencies' location is greatly appreciated.wrote on 2 Jan 2022, 19:40 last edited by JonB 1 Feb 2022, 19:40@JoeJoe_000
To install a Qt application you have written you are supposed to use something like linuxdeployqt. Are you doing so? -
Hello I'm trying to deploy an application in Linux, in Qt Creator I build in release mode and everything looks good. When I attempt to run the application from the terminal or from file manager it won't run. When I run from the terminal I get the message:
(executable file created in creator) error while loading shared libraries: (dependencies filename) cannot open shared object file: No such file or directory
when I run an ldd -d on my executable I can see the following:
lib from core location => not found
When I attempt to copy this to the same directory there is no effect, and when I attempt to point to the dependencies location I can't seem to change the not found error. Assistance on how to point to the dependencies' location is greatly appreciated.wrote on 3 Jan 2022, 03:37 last edited by@JoeJoe_000 said in Try to deploy a Subdirs project in Linux.:
when I run an ldd -d on my executable I can see the following:
lib from core location => not foundYour issue is not related to the subdirs type of project.
On Linux you need to instruct the linker to write the location of the used libs into the executable like this (supposed you use qmake):YOUR_LIB = /usr/local INCLUDEPATH += \ $${YOUR_LIB}/include unix::!mac { LIBS += -Wl,-rpath=$${YOUR_LIB}/lib }
You need to add these lines to the pro-file of the application, not the pro-file of the root directory.
-
@JoeJoe_000 said in Try to deploy a Subdirs project in Linux.:
when I run an ldd -d on my executable I can see the following:
lib from core location => not foundYour issue is not related to the subdirs type of project.
On Linux you need to instruct the linker to write the location of the used libs into the executable like this (supposed you use qmake):YOUR_LIB = /usr/local INCLUDEPATH += \ $${YOUR_LIB}/include unix::!mac { LIBS += -Wl,-rpath=$${YOUR_LIB}/lib }
You need to add these lines to the pro-file of the application, not the pro-file of the root directory.
wrote on 3 Jan 2022, 07:56 last edited by@django-Reinhard said in Try to deploy a Subdirs project in Linux.:
-rpath=$${YOUR_LIB}/lib
The OP says he is trying to deploy the application, presumably to another machine. Doesn't the above "bake in" a path on the development machine which may not be correct on the deployment machine?
-
@django-Reinhard said in Try to deploy a Subdirs project in Linux.:
-rpath=$${YOUR_LIB}/lib
The OP says he is trying to deploy the application, presumably to another machine. Doesn't the above "bake in" a path on the development machine which may not be correct on the deployment machine?
wrote on 3 Jan 2022, 08:57 last edited by@JonB said in Try to deploy a Subdirs project in Linux.:
Doesn't the above "bake in" a path on the development machine which may not be correct on the deployment machine?
Sure!
May be I didn't understand the TO right. I thought he want to call the executable from a different location (possibly on the same machine).
I had similar problem on my machine, that the shared libs where not found after copying the app to different location.
With the "right" path baken in, it works like expected. -
@JonB said in Try to deploy a Subdirs project in Linux.:
Doesn't the above "bake in" a path on the development machine which may not be correct on the deployment machine?
Sure!
May be I didn't understand the TO right. I thought he want to call the executable from a different location (possibly on the same machine).
I had similar problem on my machine, that the shared libs where not found after copying the app to different location.
With the "right" path baken in, it works like expected.wrote on 3 Jan 2022, 09:00 last edited by@django-Reinhard
Since the OP talks about "deploying" his Linux app, that is why I asked aboutlinuxdeployqt
which is the usual tool to accomplish this, guaranteeing that the target system gets the right libraries in the right places on the new system. -
wrote on 3 Jan 2022, 14:01 last edited by
Then i thank you for the clear explanation.
Possibly I can even use the tool some day -
Then i thank you for the clear explanation.
Possibly I can even use the tool some daywrote on 3 Jan 2022, 14:06 last edited by JonB 1 Mar 2022, 14:07@django-Reinhard
Fortunately I do not distribute any Qt apps, so I have never used them :) But if I did I would be looking at usinglinuxdeployqt
andwindeployqt
.
1/8