Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. [Help] Configure static compile with Qt 5.0.2
QtWS25 Last Chance

[Help] Configure static compile with Qt 5.0.2

Scheduled Pinned Locked Moved Installation and Deployment
7 Posts 2 Posters 7.6k Views
  • 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.
  • P Offline
    P Offline
    phuongvu_0203
    wrote on last edited by
    #1

    I build an GUI application based on Qt 5.0.2 in Ubuntu platfrom, then I copied the build folder into another Ubuntu machine and run it, but I got the error in terminal

    bq. error while loading shared libraries: libQt5WebKitWidgets.so.5: cannot open shared object file: No such file or directory.

    bq. error while loading shared libraries: libQt5Widgets.so.5: cannot open shared object file: No such file or directory

    After take a look at Google, I figured out that the problem is about static compile (share library and static library). I try to do some instruction with older Qt version, but not successful.

    Could everyone tell me how can I fix that problem or give me some ideas for configuring Qt 5.0.2 to be static compile? please.
    thannk you so much

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      Please mind the license when attempting to compile statically. LGPL is restrictive in that regard. There are other ways to deploy an application without compiling it statically (LD_LIBRARY_PATH is one of them, or waiting for distros to include Qt5 in their repos). Also, Qt 5.0.2 can cause problems when compiled statically and if your app is using QML2.

      You need to tell us how "not successful" you have been. What have you tried, what were the errors you've got?

      (Z(:^

      1 Reply Last reply
      0
      • P Offline
        P Offline
        phuongvu_0203
        wrote on last edited by
        #3

        I'm new in Qt, I've just used to Qt for 2 weeks and I don't know it clearly. Could you please tell me how to deploy it without compile statically? How can I use LD_LIBRARY_PATH? :(

        When I'm at another computer without installing Qt and try to run my simple application. I used this command to see all shared library which my program need:
        @ldd MyAppName@

        I realize that some missing library files. I copied manually the library files (pasted them into /usr/lib/i386-linux-gnu/) from computer which has intalled Qt to the target computer and try to run the program again. Finally, all of necessary library files are available, but I got the following error:

        @Failed to load platform plugin "xcb". Available platforms are: @
        @Aborted (core dumped)@

        I need advices from you so much...
        Thank you

        1 Reply Last reply
        0
        • sierdzioS Offline
          sierdzioS Offline
          sierdzio
          Moderators
          wrote on last edited by
          #4

          You need to copy the platform plugin, too (it was libqxcb.so, IIRC). And of course, install all dependencies. I'm not sure, for me it just works.

          As for LD_LIBRARY_PATH - it's an env variable that tells the OS where to look for libraries. So you need to point it to where you have placed Qt libs (could be Qt installation dir, or your application's root folder - as you wish).

          (Z(:^

          1 Reply Last reply
          0
          • P Offline
            P Offline
            phuongvu_0203
            wrote on last edited by
            #5

            I appreciate your reply, Sierdzio
            I tried and try so much, I coppied libqxcb.so into /usr/lib/i386-linux-gnu/ and trying load it in my project as well
            @LIBS += "./libqxcb.so"@

            But I got the same error

            @Failed to load platform plugin "xcb". Available platforms are: Aborted (core dumped)@

            I don't know what dependencies are...
            Look forward to your reply

            1 Reply Last reply
            0
            • P Offline
              P Offline
              phuongvu_0203
              wrote on last edited by
              #6

              I copied platforms directory which contains libqxcb.so into my app folder and run my app again. It seems to realize some available platforms but cannot load it..
              @Failed to load platform plugin "xcb". Available platforms are:
              linuxfb
              minimal
              xcb@
              what happen?

              1 Reply Last reply
              0
              • P Offline
                P Offline
                phuongvu_0203
                wrote on last edited by
                #7

                I've solved this problem.
                I build my own library and uses LD_LIBRARY_PATH point to it.
                @Failed to load platform plugin "xcb"@
                I copy platforms directory from Qt and paste it into my project folder. It works.

                1 Reply Last reply
                0

                • Login

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