Unsolved Execute program issue on different os
-
@victor-wang Your description is not clear: you build on your PC and then copy it to another PC with Debian and try to execute it there?
-
-
-
@J.Hilk
I'm not really understand what it means.
Please help. -
@victor-wang I geuss Qt version in your Debian machine is different to what you use on the machine where you build. That's why you get this error.
You can either build your app on Debian.
Or, as @J-Hilk suggested, deploy your app to your Debian machine. "Deploy" means - create a package containing the app and all needed Qt libraries and plug-ins.
"But i'm not quite sure what does /path/to/Qt mean?" - well, what could it mean? It is the path to Qt source code.
But you should skip the "Static linking" part of that description. Read "Creating the Application Package" and do what is described there. -
@jsulm
I wish could do it without compiling again.For the document:
The project mean the working project or the whole Qt project?
About the third approach that it suggests.
I have to make a shell script with my project and execute it on my Debian right?I assume that appname is my execution file.
But I don't know what is "basename $0 | sed s,.sh$,," mean and dirname could be?#!/bin/sh appname=`basename $0 | sed s,\.sh$,,` dirname=`dirname $0` tmp="${dirname#?}" if [ "${dirname%$tmp}" != "/" ]; then dirname=$PWD/$dirname fi LD_LIBRARY_PATH=$dirname export LD_LIBRARY_PATH $dirname/$appname "$@"
Please help!
-
@victor-wang It means your project.
You don't need to change anything in the script. You only need to give it the same name as your app + ".sh" extension: MY_APP_NAME.sh
The script alone is not enough: you need to have Qt libs used by your app and Qt plug-in in the package as well (described on that site). Please read the description carefully and do it as described there. -
@jsulm
Is this what it means?
I got a cross_execute file that i named myself.
Inside the file are producttestingtool_qt5 which is my executable file and a producttestingtool_qt5.sh which i just copy the content of what it said in the document inside the shell script.If it is right what else do i need to add?
Like what it said about the plugins, is that mean if i execute the producttestingtool_qt5.sh then will automatically get the .so file? -
@jsulm
Sorry, i have to fix it.
I think it mean like this
Here is the componentIt has to be my whole Project and have the execution file in the project.
And this is what inside the shell script.
shell script -
@victor-wang said in Execute program issue on different os:
If it is right what else do i need to add?
You need to read the description.
Executing the shell script will not magically copy any libraries - this shell script is meant to be used to START your app. YOU need to copy the libs and plug-ins. Please read the description! There is even an example showing what must be where.
Your executable must be in the SAME directory as the shell script, not in a subdirectory! -
@jsulm
I see so i need to add lib and plugins too."Either you have to manually copy the plugins into the plugins directory, or you can set the DESTDIR in the plugins' project files:"
I assume that it means i have to find the /plugandpaint/plugins and copy it into the same directly with my shell script right?
And there are .so file and platform which is inside the plugins right?
-
@victor-wang plugandpaint is just an example app!
Plug-ins are in qt/5.8/gcc_64/plugins (or somewhere else, depends on how you installed Qt).
Yes you need to copy plug-ins which are used by your app.
Libs are in qt/5.8/gcc_64/lib, copy those which are needed by your app.
You can doldd YOUR_APP
in a terminal to find out which libs are needed.
-
Hi,
Take a look at the linuxdeployqt tool. It should make your life easier.