88

I want to start a cross-platform project. I had my researches and now I am almost certain Qt is the right deal. There is a big obstacle here though: licensing.

I want to sell my project and I also don't want to give out any source related to my work or pay for a license. I checked and noticed Qt offers both commercial and open source solutions. I have heard too many conflicting sayings on Qt licensing which confused me a lot. Some say that even if I use LGPL version of Qt, I still need to submit my code. Is this true?

Can someone give me a simple explanation on Qt licenses and tell me if I can sell my application without any kind of restrictions at all or not? Would anyone tell me any other equivalents to Qt for cross-platform development without any restrictions?

Hossein
  • 24,202
  • 35
  • 119
  • 224
  • 5
    This question boils down to legal matters. Those are unfortunately off-topic here on SO. – Bart Aug 16 '12 at 19:24
  • 2
    I have a dilemma on the subject, There is no quarrelsome on the licensing itself! just how they are treated, and how they effect me in the development process.So i think it is perfectly fine to ask such a question. – Hossein Aug 16 '12 at 19:56
  • The licensing tag wiki explicitly says "Do not ask for legal advice." which is what I think this boils down to. But perhaps you can ask for clarification on Meta if you feel I'm wrong and want a "second" opinion. – Bart Aug 16 '12 at 20:02
  • 1
    I'm not seeking any advice for going commercial or LGPL , i just need some clarification on the licensing system itself.So i would be grateful if you open this question for further clarification on the subject. – Hossein Aug 16 '12 at 20:08
  • 1
    Then come to Meta. Ask whether or not with your formulation the question is on topic and could be reopened. It needs either a moderator or 5 people with sufficient privileges to reopen it. Just make it a friendly question there and the community will have a look. http://meta.stackoverflow.com – Bart Aug 16 '12 at 20:09
  • So you mean , i need to ask this question there? at meta?And it will be Ok? – Hossein Aug 16 '12 at 20:12
  • There you can at least discuss it. I can't guarantee it will be reopened. – Bart Aug 16 '12 at 20:13
  • 1
    Meta is awesome so long as you don't really care about your Meta rep. Voting is much more liberal there. – rlemon Aug 16 '12 at 20:23
  • @Hossein I meant you should ask on Meta whether your question here is on-topic and good for Stack Overflow. Then perhaps it can be reopened. You should not just ask this question on Meta. – Bart Aug 16 '12 at 20:25
  • The Meta question about this question is available [here](http://meta.stackexchange.com/q/143807/131713). – Pops Aug 16 '12 at 21:04

1 Answers1

103

Just dynamically link to Qt. If you dynamically link to LGPL libraries, there's nothing to worry about.

If you statically link to them, you can just distribute your object files (not your source code), and you'll be fine.

The idea of the LGPL is that the end user has to be able to replace the LGPL library with a version they want. Dynamically linking to the LGPL library lets you do that, as does statically linking and distributing your object files. So long as you do this, you can sell your closed source program all you want.

Of course, there's more to the LGPL than just this, but that's the relevant part.

Cornstalks
  • 37,137
  • 18
  • 79
  • 144
  • 7
    The LGPL also requires that you "do not restrict modification of the portions of the Library contained in the Combined Work and reverse engineering for debugging such modifications," which may conflict with some commercial EULAs' prohibitions on reverse engineering. – Josh Kelley Aug 16 '12 at 19:29
  • Thank you very much.So basically this means that i eaither have to release my dlls? or .lib files to the public in order to be able to sell my application? If that is the case , then whats the point in selling my application! my competitors will use my work ( as dll or .lib ) and use it for their own!Is it not that bad? – Hossein Aug 16 '12 at 19:51
  • 15
    @Hossein Did you even read the answer? This has _nothing_ to do with _your_ code. Qt's LGPL license relates to Qt and Qt only, so you can package your code and license it however you like, but unless you plan on buying a Qt commercial license, you have to dynamically link to Qt. Qt's commercial license is for when you wish to modify _Qt's_ source code, and *not* release the changes you have made to the public. – cmannett85 Aug 16 '12 at 22:32
  • @cbamber85:So it doesnt mean that when i want to use a LGPL library or file,I have to make my work LGPL in regards to it as well?And All in all i will be fine as far as i have not changed any Qt library right?:) – Hossein Aug 17 '12 at 00:01
  • 1
    @Hossein: And as long as you dynamically link to Qt. Honestly, you should just get a lawyer. You should always talk to one before engaging in a commercial venture. And FWIW, IANAL. – Cornstalks Aug 17 '12 at 01:16
  • 2
    @Hossein, Users should be able te reverse engineer and completely replace Qt itself. However, this means that you should NOT prohibit reverse engineering. You have to distribute Qt as DLLs.... and for a bonus, your app's Object files (not mandatory). If you CARE about your object files, you should then also care about your EXE! Because for a guy that knows how to use Object files, he also knows what EXACTLY is an EXE! Thse people tend to care about low-level stuff, and they know far more than us. For them, even your EXE may be as readable as your source code to you :P – Петър Петров Jan 07 '15 at 22:20
  • 1
    @ПетърПетров Yes, reverse engineering is a real concern when using LGPL libraries. However, executables are usually much more difficult to reverse engineer than a bunch of object files (namely because executables are usually stripped, have link-time optimizations and inlining applied, etc.). But you're absolutely right: if you aren't careful about how you build your executable, it might be just as easy to reverse engineer as all your object files. – Cornstalks Jan 07 '15 at 22:32
  • That's why DLLs alone suffice in 99% of time. – Петър Петров Jan 12 '15 at 18:59
  • @Cornstalks Great answer! one question, why statically link is allowed? We can check whether QT source code is modified by, for example, md5 qt5core.dll. But if it is statically linked, how can we know QT code is modified or not? – camino Oct 30 '18 at 15:49
  • You can use QT for free if you don't modify QT's source code, right? – camino Oct 30 '18 at 15:53