Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Execute program issue on different os
Forum Updated to NodeBB v4.3 + New Features

Execute program issue on different os

Scheduled Pinned Locked Moved Unsolved General and Desktop
14 Posts 4 Posters 3.6k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    victor wang
    wrote on last edited by A Former User
    #1

    Hi, I'm using qt5.5 on my QT.
    I using this commend to get the execute program.

    qmake work.pro
    make
    

    And when i execute the program on my QT, It works perfect.
    But when i execute the program on debian, it will show this errors.

    ./producttestingtool_qt5: symbol lookup error: ./producttestingtool_qt5: undefined symbol: _ZN6QDebugD1Ev
    

    I had installed this on my Debian already.

    apt-get install qt5-default
    apt-get install libqt5serialport5-dev
    

    But it still shows errors.
    How can i fix this problem?

    Please help!

    jsulmJ J.HilkJ 2 Replies Last reply
    0
    • V victor wang

      Hi, I'm using qt5.5 on my QT.
      I using this commend to get the execute program.

      qmake work.pro
      make
      

      And when i execute the program on my QT, It works perfect.
      But when i execute the program on debian, it will show this errors.

      ./producttestingtool_qt5: symbol lookup error: ./producttestingtool_qt5: undefined symbol: _ZN6QDebugD1Ev
      

      I had installed this on my Debian already.

      apt-get install qt5-default
      apt-get install libqt5serialport5-dev
      

      But it still shows errors.
      How can i fix this problem?

      Please help!

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @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?

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      V 1 Reply Last reply
      0
      • V victor wang

        Hi, I'm using qt5.5 on my QT.
        I using this commend to get the execute program.

        qmake work.pro
        make
        

        And when i execute the program on my QT, It works perfect.
        But when i execute the program on debian, it will show this errors.

        ./producttestingtool_qt5: symbol lookup error: ./producttestingtool_qt5: undefined symbol: _ZN6QDebugD1Ev
        

        I had installed this on my Debian already.

        apt-get install qt5-default
        apt-get install libqt5serialport5-dev
        

        But it still shows errors.
        How can i fix this problem?

        Please help!

        J.HilkJ Offline
        J.HilkJ Offline
        J.Hilk
        Moderators
        wrote on last edited by
        #3

        @victor-wang

        have a look here, on how to deploy QT-Apps under Linux


        Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


        Q: What's that?
        A: It's blue light.
        Q: What does it do?
        A: It turns blue.

        V 1 Reply Last reply
        1
        • jsulmJ jsulm

          @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?

          V Offline
          V Offline
          victor wang
          wrote on last edited by
          #4

          @jsulm

          Yes, and it will show the error out.
          And i'm not quite sure why it will happened.

          @J-Hilk
          Sorry, I have look at it.
          But i'm not quite sure what does /path/to/Qt mean?
          And is all this commends doing in the place where i want to execute?

          1 Reply Last reply
          0
          • J.HilkJ J.Hilk

            @victor-wang

            have a look here, on how to deploy QT-Apps under Linux

            V Offline
            V Offline
            victor wang
            wrote on last edited by
            #5

            @J.Hilk
            I'm not really understand what it means.
            Please help.

            jsulmJ 1 Reply Last reply
            0
            • V victor wang

              @J.Hilk
              I'm not really understand what it means.
              Please help.

              jsulmJ Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @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.

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              V 1 Reply Last reply
              0
              • jsulmJ jsulm

                @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.

                V Offline
                V Offline
                victor wang
                wrote on last edited by victor wang
                #7

                @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!

                jsulmJ 1 Reply Last reply
                0
                • V victor wang

                  @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!

                  jsulmJ Offline
                  jsulmJ Offline
                  jsulm
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  @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.

                  https://forum.qt.io/topic/113070/qt-code-of-conduct

                  V 2 Replies Last reply
                  0
                  • jsulmJ jsulm

                    @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.

                    V Offline
                    V Offline
                    victor wang
                    wrote on last edited by
                    #9

                    @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.

                    Here is the picture

                    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?

                    jsulmJ 1 Reply Last reply
                    0
                    • jsulmJ jsulm

                      @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.

                      V Offline
                      V Offline
                      victor wang
                      wrote on last edited by victor wang
                      #10

                      @jsulm
                      Sorry, i have to fix it.
                      I think it mean like this
                      Here is the component

                      It has to be my whole Project and have the execution file in the project.

                      And this is what inside the shell script.
                      shell script

                      1 Reply Last reply
                      0
                      • V victor wang

                        @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.

                        Here is the picture

                        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?

                        jsulmJ Offline
                        jsulmJ Offline
                        jsulm
                        Lifetime Qt Champion
                        wrote on last edited by
                        #11

                        @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!

                        https://forum.qt.io/topic/113070/qt-code-of-conduct

                        V 1 Reply Last reply
                        0
                        • jsulmJ jsulm

                          @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!

                          V Offline
                          V Offline
                          victor wang
                          wrote on last edited by
                          #12

                          @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?

                          document

                          And there are .so file and platform which is inside the plugins right?

                          jsulmJ 1 Reply Last reply
                          0
                          • V victor wang

                            @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?

                            document

                            And there are .so file and platform which is inside the plugins right?

                            jsulmJ Offline
                            jsulmJ Offline
                            jsulm
                            Lifetime Qt Champion
                            wrote on last edited by
                            #13

                            @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 do

                            ldd YOUR_APP
                            

                            in a terminal to find out which libs are needed.

                            https://forum.qt.io/topic/113070/qt-code-of-conduct

                            1 Reply Last reply
                            0
                            • SGaistS Offline
                              SGaistS Offline
                              SGaist
                              Lifetime Qt Champion
                              wrote on last edited by
                              #14

                              Hi,

                              Take a look at the linuxdeployqt tool. It should make your life easier.

                              Interested in AI ? www.idiap.ch
                              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                              1 Reply Last reply
                              1

                              • Login

                              • Login or register to search.
                              • First post
                                Last post
                              0
                              • Categories
                              • Recent
                              • Tags
                              • Popular
                              • Users
                              • Groups
                              • Search
                              • Get Qt Extensions
                              • Unsolved