I'm just wondering if the below is true? I pulled this from another forum. Does this mean that a application using qt4 can be built and used in a bank without getting permission or paying fees for it's use?

The Framework is freely available for Windows, Linux, MacOS X, and a couple of mobile systems. Since version 4.5 the license is LGPL, which basically means that you can use Qt even in commercial applications.

thanks
danny2000

Assuming you meet the requirements of LGPL, it seems that way. This is cool, I wasn't aware Qt had moved to an open source library model. That's what had kept me from using it. :)

I agree deceptikon. I have been doing the same. I was just about to buy a book on wxwidgets and found that post. http://stackoverflow.com/questions/875686/advice-for-c-gui-programming
If anyone could let me know if I've interpreted this correctly that would be great. Like most, I just want to know for sure before using it full time.

thanks
danny2000

Would anyone know what is meant by dynamically linking to qt libraries??

Well, this is just a matter of knowing what dynamic linking means. Take wiki for a start. As a quick explanation, let me start from the basics. You have some code. In a usual project, you'll have a bunch of cpp files and their corresponding header files (declaring what is in the cpp files). Normally, on a small project, you compile all the cpp files together into an executable. In reality, the compiler compiles each cpp file separately into object files (.o or .obj) which contain the compiled code for the code in each cpp file, then, after the compiler is done, the linker puts all the object files together and links all the function calls to their corresponding binary code. Well, on a bigger project, or when using external libraries, you often won't do that. Instead, you can compile a bunch of cpp files and put all the resulting binary code into a library, which is like a repository of precompiled code (functions, classes, etc.). You can use that code in any program if you have all the header files for that library, but you don't need the cpp files (where all the real source code is), you only need to tell the compiler to link the library into your project. Now, there are two kinds of libraries, static and dynamic. A static library is merely a bundle of object files, and when you link to it in your own project, all the code that you use from it gets physically incorporated (copied) into your final executable. A dynamic library (like a DLL or .so) is a bit more than a bundle of object files and it is meant to be linked with your program at run-time (or load-time) of your application. This means that the DLL or .so file must be installed on the system directories of the OS, and when you launch your application, it will find this DLL or .so on your system, load it, and link to it (in order to be able to find code that is needed by your application). So, the dynamic libraries must be installed separately on the system, ahead of time (of course, you can check for that when you package your installer for you application).

The point with LGPL in a context like Qt, is that the Qt "platform" consists of a bunch of dynamic libraries and their associated header files. You write your program, using the header files to access to functions and all, you compile it, and then run it using the dynamic libraries installed on the system. If that is all you do, then your program can be commercial, proprietary, whatever... It is only if you modify the source (cpp files) of Qt libraries (to suite your own needs) that you must either make your own program open-source or negociate another licensing deal with Qt (possibly paying them royalty, because Qt does offer commercial licenses as well). But as long as you don't modify anything in Qt, and as long as you don't recompile Qt code and include it statically into your application, you're fine to use it for whatever purpose.

Does this mean that when compiling a project build in qt4 I need to be online?

No. It only means that if you distribute your application, you will need to direct the user to install Qt (run-time) on their system if they haven't done so already. You can also bundle the Qt installation with your own. This is the same as many computer games that include the "latest" DirectX version on their CD or DVD, the installer checks if you have the minimum required version already on your computer, if not, it starts the DirectX installer. You can basically do the same, or just check if the minimum required version of Qt is installed already, and if not, direct the user to the online downloader / installer for Qt run-time libraries. Here is more information, go to the "shared library" section ("shared library" and "dynamic-link library" are synonyms, although "shared library" is more traditionally used by Unix/Linux developers).

can basically do the same, or just check if the minimum required version of Qt is installed already, and if not, direct the user to the online downloader / installer for Qt run-time libraries. Here is more information, go to the "shared library" section ("shared library" and "dynamic-link library" are synonyms, although "shared library" is more traditionally used by Unix/Linux developers).

brilliant, thanks for the help on this. I'm happy I understand this now. Yes, I definetly have some work to do.

cheers
danny2000

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.