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. Qt 5.1.1 + 64bit ubuntu 13.10 standalone app
Forum Updated to NodeBB v4.3 + New Features

Qt 5.1.1 + 64bit ubuntu 13.10 standalone app

Scheduled Pinned Locked Moved Installation and Deployment
6 Posts 2 Posters 4.1k Views 1 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.
  • E Offline
    E Offline
    erik.kubica
    wrote on last edited by
    #1

    Hi,

    after 2 days of googling and su*king with compile, i decided to ask here.

    I have made simple music player as Qt Gui Application, that runs on my PC perfektly. But when i copy it into other PC where Qt libs is not installed, it gives segmentation fault error. So i searched for solution. Static linking..

    So i downloaded the qt-everywhere-opensource-src-5.1.0-rc2.zip, extracted it and configured with:
    @./configure -static -release
    make -j 4
    @

    After compile done, i added the libs using: Right click on project -> add library -> external library
    I reated this step for: libQt5Multimedia.a, libQt5Core.a, libQt5Gui.a

    my executable now had 14.8MB instead of 808kB.

    problem is, when i run the app, it says
    @Starting /home/erik/QtProjs/build-QtPlayer-Desktop_Qt_5_1_1_GCC_64bit-Release/ePlayer...
    Failed to load platform plugin "xcb". Available platforms are:

    The program has unexpectedly finished.
    /home/erik/QtProjs/build-QtPlayer-Desktop_Qt_5_1_1_GCC_64bit-Release/ePlayer exited with code 0@

    So i tried:
    @#include <QtPlugin>

    int main(int argc, char *argv[]) {
    Q_IMPORT_PLUGIN(QXcbIntegrationPlugin)
    ......
    @

    and i am getting undefined reference error, i saw this in bugreport, but theoretically this is fixed in RC2 and i am using rc2.

    So i have tried to build Qt with "-qt-xcb -nomake examples" but i got the same error (Failed to load....)

    Please help, i will be happy :-\

    Also i am interested in license how it works, Can i release this player for free to ubuntu software center? As opensource.

    Thank you.

    --- Edit ---

    My project file:

    @
    #-------------------------------------------------

    Project created by QtCreator 2013-10-25T12:26:07

    #-------------------------------------------------

    QT += core gui
    QT += multimedia

    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

    TARGET = ePlayer
    TEMPLATE = app

    SOURCES += main.cpp
    mainwindow.cpp

    HEADERS += mainwindow.h

    FORMS += mainwindow.ui

    RESOURCES +=
    resources.qrc

    RC_FILE = myapp.rc

    CONFIG += static

    win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../Downloads/qt-everywhere-opensource-src-5.1.0-rc2/qtmultimedia/lib/release/ -lQt5Multimedia
    else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../Downloads/qt-everywhere-opensource-src-5.1.0-rc2/qtmultimedia/lib/debug/ -lQt5Multimedia
    else:unix: LIBS += -L$$PWD/../../Downloads/qt-everywhere-opensource-src-5.1.0-rc2/qtmultimedia/lib/ -lQt5Multimedia

    INCLUDEPATH += $$PWD/../../Downloads/qt-everywhere-opensource-src-5.1.0-rc2/qtmultimedia/include
    DEPENDPATH += $$PWD/../../Downloads/qt-everywhere-opensource-src-5.1.0-rc2/qtmultimedia/include

    win32:CONFIG(release, debug|release): PRE_TARGETDEPS += $$PWD/../../Downloads/qt-everywhere-opensource-src-5.1.0-rc2/qtmultimedia/lib/release/Qt5Multimedia.lib
    else:win32:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$PWD/../../Downloads/qt-everywhere-opensource-src-5.1.0-rc2/qtmultimedia/lib/debug/Qt5Multimedia.lib
    else:unix: PRE_TARGETDEPS += $$PWD/../../Downloads/qt-everywhere-opensource-src-5.1.0-rc2/qtmultimedia/lib/libQt5Multimedia.a

    win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../Downloads/qt-everywhere-opensource-src-5.1.0-rc2/qtbase/lib/release/ -lQt5Core
    else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../Downloads/qt-everywhere-opensource-src-5.1.0-rc2/qtbase/lib/debug/ -lQt5Core
    else:unix: LIBS += -L$$PWD/../../Downloads/qt-everywhere-opensource-src-5.1.0-rc2/qtbase/lib/ -lQt5Core

    INCLUDEPATH += $$PWD/../../Downloads/qt-everywhere-opensource-src-5.1.0-rc2/qtbase/include
    DEPENDPATH += $$PWD/../../Downloads/qt-everywhere-opensource-src-5.1.0-rc2/qtbase/include

    win32:CONFIG(release, debug|release): PRE_TARGETDEPS += $$PWD/../../Downloads/qt-everywhere-opensource-src-5.1.0-rc2/qtbase/lib/release/Qt5Core.lib
    else:win32:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$PWD/../../Downloads/qt-everywhere-opensource-src-5.1.0-rc2/qtbase/lib/debug/Qt5Core.lib
    else:unix: PRE_TARGETDEPS += $$PWD/../../Downloads/qt-everywhere-opensource-src-5.1.0-rc2/qtbase/lib/libQt5Core.a

    win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../Downloads/qt-everywhere-opensource-src-5.1.0-rc2/qtbase/lib/release/ -lQt5Gui
    else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../Downloads/qt-everywhere-opensource-src-5.1.0-rc2/qtbase/lib/debug/ -lQt5Gui
    else:unix: LIBS += -L$$PWD/../../Downloads/qt-everywhere-opensource-src-5.1.0-rc2/qtbase/lib/ -lQt5Gui

    INCLUDEPATH += $$PWD/../../Downloads/qt-everywhere-opensource-src-5.1.0-rc2/qtbase/include
    DEPENDPATH += $$PWD/../../Downloads/qt-everywhere-opensource-src-5.1.0-rc2/qtbase/include

    win32:CONFIG(release, debug|release): PRE_TARGETDEPS += $$PWD/../../Downloads/qt-everywhere-opensource-src-5.1.0-rc2/qtbase/lib/release/Qt5Gui.lib
    else:win32:CONFIG(debug, debug|release): PRE_TARGETDEPS += $$PWD/../../Downloads/qt-everywhere-opensource-src-5.1.0-rc2/qtbase/lib/debug/Qt5Gui.lib
    else:unix: PRE_TARGETDEPS += $$PWD/../../Downloads/qt-everywhere-opensource-src-5.1.0-rc2/qtbase/lib/libQt5Gui.a
    @

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

      Qt is not standalone, it has multiple dependencies. Either install Qt5 prepared for your distro (it's likely to be outdated), or bundle Qt libs with your app (your current approach, but please mind the LGPL licensing issues with static linking), but then you still need to install the dependencies on the user's machine, too.

      For an overbloated (because it includes the dev packages, which are not needed by users) list of dependencies, see "link":http://qt-project.org/wiki/Building-Qt-5-from-Git.

      (Z(:^

      1 Reply Last reply
      0
      • E Offline
        E Offline
        erik.kubica
        wrote on last edited by
        #3

        I have installed all dependencies from the url you provided, before asking here.

        I am trying to bundle it, but i am extremly noob to license types. I builded the opensource editon not comercial.
        There is a player in software center named: qmmp, its qt4 based, when installed it have 6MB, not requires qt installed on system. and it does not install qt to system.

        i want to make my app like this. I am looking here for some guide how to do it. If its not possible i will throw Qt away and i will trying with c++ / python + gtk

        I am more java & php developer, everything what i know about linking libs and compiling c++ code is in my first post.

        Thanks for you answer

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

          OK well this is such a broad topic that it's hard for me to give you a good, elaborate answer - I would have to write, and write, and write... ;)

          First: licensing. If your app is OpenSource/ Free software, you can safely use static compilation, so no worries there.

          In general, on Linux, shared libraries are preferred way of doing things, among with using package managers: so that all the user needs to do is to double click a .deb or .rpm package. Seems nice and easy, but is not so seamless on the development side: distros vary a lot.

          You can bundle everything together (it's MUCH easier with Qt4 than 5, though), there are several thread about it on this forum. I'll try to find some links and get back to you soon.

          (Z(:^

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

            Some info "here":http://qt-project.org/wiki/Deploying_a_Qt5_Application_Linux.

            And "here":http://www.youtube.com/watch?feature=player_embedded&v=chMNUzpN4pw.

            (Z(:^

            1 Reply Last reply
            0
            • E Offline
              E Offline
              erik.kubica
              wrote on last edited by
              #6

              Thank you for yout time and all answers, all of them was very usefull. i used maybe wrong keywords when searching for static compilation under linux.

              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