Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Forum Updated on Feb 6th

    Unsolved Creating Release build for Ubuntu based system

    Installation and Deployment
    3
    5
    1387
    Loading More Posts
    • 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.
    • A
      Adersh last edited by

      Hi,

      Am developing QtWidget based application and which used OpenGL. As per the requirement I have to use Qt 5.7.0 and Ubuntu 16.04 (with Virtual Box) and CMake is used for build project(Version of CMake I use is 3.5.0). The application works fine on my local machine(debug and release mode).

      Issue is that when I copy executables file generated in release mode application didn't start, dependency of my executables looks fine when I execute ldd application command.

      Using CMake only (Without using Qt Creator) release build works fine in all machines. But still the GUI text allignments and locations are not as like I designed.

      Is anything else need to be take care before generate release build using Qt Creator?
      Please help.

      JKSH 1 Reply Last reply Reply Quote 0
      • JKSH
        JKSH Moderators @Adersh last edited by

        @Adersh said in Creating Release build for Ubuntu based system:

        Issue is that when I copy executables file generated in release mode application didn't start

        What do you mean by "didn't start"? Does it show you any error messages?

        dependency of my executables looks fine when I execute ldd application command.

        ldd only shows you the load-time dependencies. It doesn't show you runtime dependencies (plugins).

        One quick and dirty method is to copy all *.so files and see if that helps.

        (I did an Ubuntu build about 2 years ago; I remember I had to copy libqt5DBus.so even though my application doesn't use D-Bus))

        Using CMake only (Without using Qt Creator) release build works fine in all machines. But still the GUI text allignments and locations are not as like I designed.

        Just to confirm I understood you correctly: If you don't use Qt Creator, the release build works on your deployment machine... But if you use Qt Creator, the release build doesn't work on your deployment machine?

        Compare the Makefiles generated by both build methods. What's the difference?

        Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

        1 Reply Last reply Reply Quote 0
        • A
          Adersh last edited by

          @JKSH Thanks for replay,

          What do you mean by "didn't start"? Does it show you any error messages?

          Yes when I run application through terminal it shows errors
          ./app: /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5: version Qt_5' not found (required by ./app) ./app: /usr/lib/x86_64-linux-gnu/libQt5Core.so.5: version Qt_5.7' not found (required by ./app)
          ./app: /usr/lib/x86_64-linux-gnu/libQt5Core.so.5: version Qt_5' not found (required by ./app) ./app: /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5: version Qt_5' not found (required by ./app)

          One quick and dirty method is to copy all *.so files and see if that helps.

          Already tried this method. But application is not working. I tried to copy all libs and set LD_LIBRARY_PATH to copied location. its shows errors
          This application failed to start because it could not find or load the Qt platform plugin “xcb”

          Just to confirm I understood you correctly: If you don't use Qt Creator, the release build works on your deployment machine... But if you use Qt Creator, the release build doesn't work on your deployment machine?

          If I didn't use Qt Creator and build using CMake only applications works fine in every machine even though I just copy paste executables to other machine. But If I use Qt Creator to build my application It is only work on my deployment machine and when I try to copy executables to another linux machine its shows this errors.

          ./app: /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5: version Qt_5' not found (required by ./app) ./app: /usr/lib/x86_64-linux-gnu/libQt5Core.so.5: version Qt_5.7' not found (required by ./app)
          ./app: /usr/lib/x86_64-linux-gnu/libQt5Core.so.5: version Qt_5' not found (required by ./app) ./app: /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5: version Qt_5' not found (required by ./app)

          Compare the Makefiles generated by both build methods. What's the difference?

          There is only one difference between makefiles, Please check below

          QtCreator MakeList
          
          #Special rule for the target edit_cache
          edit_cache:
          	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "No interactive CMake dialog available..."
          	/usr/bin/cmake -E echo No\ interactive\ CMake\ dialog\ available.
          .PHONY : edit_cache
          
          CMake MakeList (Without using Qt Creator
          
          #Special rule for the target edit_cache
          edit_cache:
          	@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake cache editor..."
          	/usr/bin/ccmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)
          .PHONY : edit_cache
          
          jsulm JKSH 2 Replies Last reply Reply Quote 0
          • jsulm
            jsulm Lifetime Qt Champion @Adersh last edited by

            @Adersh You should check http://doc.qt.io/qt-5/linux-deployment.html

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

            1 Reply Last reply Reply Quote 0
            • JKSH
              JKSH Moderators @Adersh last edited by

              @Adersh said in Creating Release build for Ubuntu based system:

              *./app: /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5: version `Qt_5' not found (required by ./app)
              ./app: /usr/lib/x86_64-linux-gnu/libQt5Core.so.5: version `Qt_5.7' not found (required by ./app)
              ./app: /usr/lib/x86_64-linux-gnu/libQt5Core.so.5: version `Qt_5' not found (required by ./app)
              

              Your app is trying to load the wrong version of the Qt libraries.

              1. In Qt Creator, click Tools -> Options... -> Build & Run -> Qt Versions. What versions of Qt do you see?
              2. In the console, call which qmake. What does it show?
              3. Which version do you want to use to build your app?

              If I didn't use Qt Creator and build using CMake only applications works fine in every machine even though I just copy paste executables to other machine. But If I use Qt Creator to build my application It is only work on my deployment machine and when I try to copy executables to another linux machine its shows this errors.

              That means, when you used CMake only, you built your app using the version of Qt that is provided by your Linux distro. However, when you used Qt Creator, you built your app using a different version of Qt.

              Which version do you want to use to build your app?

              One quick and dirty method is to copy all *.so files and see if that helps.

              Already tried this method. But application is not working. I tried to copy all libs and set LD_LIBRARY_PATH to copied location. its shows errors
              This application failed to start because it could not find or load the Qt platform plugin “xcb”

              That means either:

              • libqxcb.so is not in the correct location, OR
              • One or more of the dependencies of libqxcb.so is missing

              See http://www.tripleboot.org/?p=138

              Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

              1 Reply Last reply Reply Quote 1
              • First post
                Last post