Creating Release build for Ubuntu based system



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


  • Moderators

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



  • @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: versionQt_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: versionQt_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: versionQt_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: versionQt_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
    

  • Moderators


  • Moderators

    @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


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.