Results 1 to 6 of 6

Thread: Static vs.dinamic linking (LGPL)

  1. #1
    Join Date
    Sep 2012
    Posts
    44
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Static vs.dinamic linking (LGPL)

    Hi,

    I'm about to make a simple program for OS X.
    As i read in order to cover LGPL rules i shoud use only dynamic linking to Qt.
    What does it mean?
    In Qt there is a tool macdeployqt which generate OSX App.Inside the needed libraries are included and this is standalone independent app.Is it static?Is Dinamic when we make an installer and the Qt libraries are installed on the machine separately?

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Static vs.dinamic linking (LGPL)

    Static linking: The parts of the Qt libraries you use are actually built into your program executable at compile/link time. The aim (usually) is to make a single -file program that does not need separate Qt libraries in support. To do this you would have to build your own Qt libraries to support static linking.

    Dynamic linking: Your program binary is separate from the dynamic libraries for Qt and connected to them only at run time. Whether the Qt libraries are provided in the application bundle or pre-installed on the system is not relevant. All the pre-built library bundles from the Qt Project site are dynamic library bundles.

    The LGPL requires that anyone you distribute your program to is able to relink your program to a modified/later Qt version. This can be arranged with statically linked program (by distributing the source, or object files and a way for the user to link them) but it is more difficult than using a dynamically linked executable where they can simply replace the Qt library binaries.

  3. The following user says thank you to ChrisW67 for this useful post:

    Iceberg9 (11th August 2015)

  4. #3
    Join Date
    Sep 2012
    Posts
    44
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Re: Static vs.dinamic linking (LGPL)

    does it mean that using macqtdeploy and get standalone app with Qt libraries inside as seprate files is dynamic linking and is OK with LGPL?

  5. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Static vs.dinamic linking (LGPL)

    If you are using only the pre-built binaries from the Qt Project then you will be dynamic linking.
    If you have not built your own Qt libs for static linking, and arranged your project to link with that version, then you are probably using dynamic linking.

    Macedeployqt produces a bundle containing your program and its Qt dependencies, if any, as private frameworks. Users of that bundle can replace the Qt frameworks if they wish.
    I suggest you read the documentation so you understand what goes into a bundle
    http://doc.qt.io/qt-5/osx-deployment.html

    The linking style is not the only condition of the LGPL you might have to meet.

  6. The following user says thank you to ChrisW67 for this useful post:

    Iceberg9 (11th August 2015)

  7. #5
    Join Date
    May 2015
    Posts
    6
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Static vs.dinamic linking (LGPL)

    Quote Originally Posted by ChrisW67 View Post
    Static linking: The parts of the Qt libraries you use are actually built into your program executable at compile/link time. The aim (usually) is to make a single -file program that does not need separate Qt libraries in support. To do this you would have to build your own Qt libraries to support static linking.

    Dynamic linking: Your program binary is separate from the dynamic libraries for Qt and connected to them only at run time. Whether the Qt libraries are provided in the application bundle or pre-installed on the system is not relevant. All the pre-built library bundles from the Qt Project site are dynamic library bundles.

    The LGPL requires that anyone you distribute your program to is able to relink your program to a modified/later Qt version. This can be arranged with statically linked program (by distributing the source, or object files and a way for the user to link them) but it is more difficult than using a dynamically linked executable where they can simply replace the Qt library binaries.
    good answer, Thanks for sharing

  8. #6
    Join Date
    Sep 2012
    Posts
    44
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Re: Static vs.dinamic linking (LGPL)

    thank you.

    I thing i cover LGPL requirements.No change of Qt, dynamic liinking, basic Qt modules for OS X.

Similar Threads

  1. Can we do static linking with third-party librarires using LGPL licence?
    By Awareness in forum Installation and Deployment
    Replies: 3
    Last Post: 30th June 2013, 14:48
  2. Replies: 3
    Last Post: 7th February 2012, 10:40
  3. Replies: 3
    Last Post: 1st June 2011, 15:32
  4. Specification on LGPL and Dynamic linking
    By elfkarr in forum Qt Programming
    Replies: 2
    Last Post: 6th February 2010, 15:43
  5. Static linking
    By didcea in forum Qt Programming
    Replies: 0
    Last Post: 11th October 2008, 18:40

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.