Results 1 to 14 of 14

Thread: Static Linux Builds

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Static Linux Builds

    When you run "configure" you can pass the install path as the "-prefix" commandline switch

    Cheers,
    _

  2. #2
    Join Date
    Jul 2016
    Location
    Tokyo, Japan
    Posts
    8
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Static Linux Builds

    And after wasting yet another 5 hours of my life, "make" stopped here:

    Qt Code:
    1. /opt/qt-everywhere-opensource-src-5.7.0/qtvirtualkeyboard/plugins/platforminputcontexts/libqtvirtualkeyboardplugin.a(plugin.o):plugin.cpp:function QVirtualKeyboardPlugin::create(QString const&, QStringList const&): error: undefined reference to 'qt_static_plugin_QtQuick2Plugin()'
    2. /opt/qt-everywhere-opensource-src-5.7.0/qtvirtualkeyboard/plugins/platforminputcontexts/libqtvirtualkeyboardplugin.a(plugin.o):plugin.cpp:function QVirtualKeyboardPlugin::create(QString const&, QStringList const&): error: undefined reference to 'qt_static_plugin_QtQuick2Plugin()'
    3. /opt/qt-everywhere-opensource-src-5.7.0/qtvirtualkeyboard/plugins/platforminputcontexts/libqtvirtualkeyboardplugin.a(plugin.o):plugin.cpp:function QVirtualKeyboardPlugin::create(QString const&, QStringList const&): error: undefined reference to 'qt_static_plugin_QtQuick2WindowPlugin()'
    4. /opt/qt-everywhere-opensource-src-5.7.0/qtvirtualkeyboard/plugins/platforminputcontexts/libqtvirtualkeyboardplugin.a(plugin.o):plugin.cpp:function QVirtualKeyboardPlugin::create(QString const&, QStringList const&): error: undefined reference to 'qt_static_plugin_QtQuick2WindowPlugin()'
    5. /opt/qt-everywhere-opensource-src-5.7.0/qtvirtualkeyboard/plugins/platforminputcontexts/libqtvirtualkeyboardplugin.a(plugin.o):plugin.cpp:function QVirtualKeyboardPlugin::create(QString const&, QStringList const&): error: undefined reference to 'qt_static_plugin_QtQuickLayoutsPlugin()'
    6. /opt/qt-everywhere-opensource-src-5.7.0/qtvirtualkeyboard/plugins/platforminputcontexts/libqtvirtualkeyboardplugin.a(plugin.o):plugin.cpp:function QVirtualKeyboardPlugin::create(QString const&, QStringList const&): error: undefined reference to 'qt_static_plugin_QtQuickLayoutsPlugin()'
    7. /opt/qt-everywhere-opensource-src-5.7.0/qtvirtualkeyboard/plugins/platforminputcontexts/libqtvirtualkeyboardplugin.a(plugin.o):plugin.cpp:function QVirtualKeyboardPlugin::create(QString const&, QStringList const&): error: undefined reference to 'qt_static_plugin_QmlFolderListModelPlugin()'
    8. /opt/qt-everywhere-opensource-src-5.7.0/qtvirtualkeyboard/plugins/platforminputcontexts/libqtvirtualkeyboardplugin.a(plugin.o):plugin.cpp:function QVirtualKeyboardPlugin::create(QString const&, QStringList const&): error: undefined reference to 'qt_static_plugin_QmlFolderListModelPlugin()'
    9. /opt/qt-everywhere-opensource-src-5.7.0/qtvirtualkeyboard/plugins/platforminputcontexts/libqtvirtualkeyboardplugin.a(plugin.o):plugin.cpp:function QVirtualKeyboardPlugin::create(QString const&, QStringList const&): error: undefined reference to 'qt_static_plugin_QtVirtualKeyboardStylesPlugin()'
    10. /opt/qt-everywhere-opensource-src-5.7.0/qtvirtualkeyboard/plugins/platforminputcontexts/libqtvirtualkeyboardplugin.a(plugin.o):plugin.cpp:function QVirtualKeyboardPlugin::create(QString const&, QStringList const&): error: undefined reference to 'qt_static_plugin_QtVirtualKeyboardStylesPlugin()'
    11. collect2: error: ld returned 1 exit status
    12. make[4]: *** [Makefile:71: basic] Error 1
    13. make[4]: Leaving directory '/opt/qt-everywhere-opensource-src-5.7.0/qtvirtualkeyboard/examples/virtualkeyboard/basic'
    14. make[3]: *** [Makefile:43: sub-basic-make_first] Error 2
    15. make[3]: Leaving directory '/opt/qt-everywhere-opensource-src-5.7.0/qtvirtualkeyboard/examples/virtualkeyboard'
    16. make[2]: *** [Makefile:43: sub-virtualkeyboard-make_first] Error 2
    17. make[2]: Leaving directory '/opt/qt-everywhere-opensource-src-5.7.0/qtvirtualkeyboard/examples'
    18. make[1]: *** [Makefile:70: sub-examples-make_first] Error 2
    19. make[1]: Leaving directory '/opt/qt-everywhere-opensource-src-5.7.0/qtvirtualkeyboard'
    20. make: *** [Makefile:804: module-qtvirtualkeyboard-make_first] Error 2
    21. [root@Linux qt-everywhere-opensource-src-5.7.0]
    To copy to clipboard, switch view to plain text mode 

  3. #3
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Static Linux Builds

    You could check if the build has already progressed far enough for your needs.

    I.e. if those libraries in Qt that your application needs have already been built.

    Cheers,
    _

  4. #4
    Join Date
    Jul 2016
    Location
    Tokyo, Japan
    Posts
    8
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Static Linux Builds

    Okay, I tried again with the "-skip qtvirtualkeyboard" parameter, and it seems like it got installed successfully this time.
    Now I tried to build it as static, and that also seemed to work.

    Now I only need to get it running on different Distributions (I'm using Arch Linux), those with Ubuntu and Linux Mint didn't seem to get it to run.
    They get this error:
    Qt Code:
    1. Cannot execute binary file: Exec format error
    To copy to clipboard, switch view to plain text mode 

    Edit:
    I tried it on 2 Live Sessions (one with Linux Mint, and one with Manjaro), and on Windows 10's Ubuntu Sub System.
    All 3 of them can't run my application, due to missing libraries (libwebp, libmng, etc.).
    Is there something I'm missing?
    Last edited by MKGirlism; 29th July 2016 at 10:27.

  5. #5
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Static Linux Builds

    Hmm, that's a strange error

    Are you perhaps building a 64-bit executable and the target systems are 32-bit?

    As for the libraries, those need to be either in the system, bundled with the application (see comment #2) or statically linked.
    Or Qt confgured to skip support for these formats.

    Cheers,
    _

  6. #6
    Join Date
    Jul 2016
    Location
    Tokyo, Japan
    Posts
    8
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Static Linux Builds

    And how do I statically link these 3rd party libraries?
    I already got Qt-specific libraries statically linked, although I find it pointless to include, let's say, "libwebp", while the App has absolutely nothing to do with networking...

  7. #7
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Static Linux Builds

    Quote Originally Posted by MKGirlism View Post
    And how do I statically link these 3rd party libraries?
    You need the static build of those libraries.

    Which is why usually no one does static linking, as it is way too much work.

    Quote Originally Posted by MKGirlism View Post
    I already got Qt-specific libraries statically linked, although I find it pointless to include, let's say, "libwebp", while the App has absolutely nothing to do with networking...
    This has nothing to do with networking, WebP is an image format.

    Usually these are plugins but since you are doing a static build of Qt these are now built into Qt.

    You can likely disable them during configure, as I said above.

    Or just not statically link Qt and only ship the image plugins you need.

    Cheers,
    _

  8. #8
    Join Date
    Jul 2016
    Location
    Tokyo, Japan
    Posts
    8
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Static Linux Builds

    Quote Originally Posted by anda_skoa View Post
    You need the static build of those libraries.
    Well, yes...quite obvious that in order to statically linking libraries, I need to statically link libraries... ( ̄ー ̄。)
    I actually asked how I should do that.
    I already tried copying stuff from "/usr/lib64", and included those libraries within the .tar.gz file I would distribute the application with, but that didn't help neither.

  9. #9
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Static Linux Builds

    Quote Originally Posted by MKGirlism View Post
    Well, yes...quite obvious that in order to statically linking libraries, I need to statically link libraries... ( ̄ー ̄。)
    I actually asked how I should do that.
    Similar to Qt: you get the sources for these libraries and configure and make static build.

    Quote Originally Posted by MKGirlism View Post
    I already tried copying stuff from "/usr/lib64", and included those libraries within the .tar.gz file I would distribute the application with, but that didn't help neither.
    Make sure your start script points the LD_LIBRARY_PATH variable to the directory you've put the libraries into.

    You can use "ldd" on the executable to see which libraries the runtime linker find when it tries to resolve the symbols needed by the program.

    Cheers,
    _

Similar Threads

  1. unable to make static builds on windows
    By mchome in forum Newbie
    Replies: 13
    Last Post: 16th July 2012, 19:42
  2. Something terribly wrong with static linux builds
    By snookie in forum Qt Programming
    Replies: 0
    Last Post: 8th June 2011, 22:22
  3. Mixing static and dynamic Qt builds.
    By End in forum Newbie
    Replies: 3
    Last Post: 2nd March 2010, 22:04
  4. Size of Static Builds
    By Stobie in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 19th January 2010, 21:24
  5. Coexisting static and shared builds of QT on windows
    By doggrant in forum Installation and Deployment
    Replies: 2
    Last Post: 10th September 2009, 16:52

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.