PDA

View Full Version : Instalation and Setting Qt4 on WindowsXP



frenk_castle
1st September 2009, 11:44
I tried to be detailed concerning my problem. If I wrote to much I apologize. Problem might be very trivial but I don't have much experience in this so please bare with me and help me if you can. If my post is in wrong topic please move it to appropriate one.

I downloaded qt-sdk-win-opensource-2009.03.1.exe file from the official qt site. During installation there were many Extracting some file messages. Toward the end several Warning could not open some dll messages appeared. The installation finished I started the Qt Creator it seemed to run just fine. I made a new project choosing empty Qt4 project. Wrote the following code:


#include <iostream>

int main()
{
std::cout << "Test!" << std::endl;
int i;
std::cin >> i;

return 0;
}


It was just to test if everything was set ok. I build the project. No errors appeared. I closed Qt Creator executed the exe file I just made in the projects debug folder and received the following message: "This application has failed to start because mingwm10.dll was not found. Re-installing the application may fix the problem."

Not knowing what the problem is I changed the Build->Set Build Configuration from debug to release built the program again executed the exe file in the release folder now but got the same message.

I then found the dll in question on my disk in folder C:\Qt\2009.03\mingw\bin. I copied it to the folder where the exe file was and my program run. Nothing appeared in the console but I figured it was because console is not used by default under Windows. Visual studio Express edition probably adds some code when I choose Win32 console application to redirect IO to it. I rewrote the code to use to txt files and it run like it should.

I kept searching on the net and found that with license I have static linking is not possible. I also found advice in the book Foundations of Qt development to always access Qt through console. Author says "It is important that you access Qt from this command prompt because it sets up the environment variables such as PATH correctly."

I have moderate experience with ANSI/ISO C++ and STL but I made mostly simple console programs to use at work to do some task that can be automated. Just some stuff to use around the office to make job faster and less manual. Fixing txt databases, searching through files, doing some queries. Utility stuff mostly. But I never did any setting to my IDE. I used Visual studio express edition 2005 for most part to write win32 console application. Now I would like to write programs that my not very computer literate colleges can use with relative ease and that can run on our Linux servers and WindowsXP workstations. Qt seems like the easiest way to do so. The least learning to be done on my part.

Now if I haven't bored you to death I would like to use the Qt, for starters for the things I mentioned it the previous paragraph and would like to now the following:

1. Is it possible to link my code statically with my, as is says on official site, LGPL licence? If it is how can I do that.

2. Is it neccesary to always start the Qt creator from the console or can I just click on the shortcut in my Start -> Programs -> Qt SDK by Nokia v2009.03 (open source) folder? I know it my be dumb question but every thing seem to run ok like this.

3. Can I write programs to use around the office with my license since I don't intend to ask money, or any other compensation, for them? I am not clear about my right so to speak and I would hate to do something I am not supposed to. I got the software free least I can do is use it responsibly.

4. Again maybe dumb question but I am under impression that I can write whole programs in Qt IDE that I downloaded. Some people tell me that Qt is just for doing the GUI and that I have to write and test code that do the "real work" somewhere else. But nobody of them has first hand experience with Qt so they might be wrong. If I can use QT to write everything my programs need is there something I need to set in either Qt or Windows to be able to do so.

5. Last but not least. Since I am very fond of console programs. They are the easiest and fastest way I know to test parts of code before I integrate them in my programs. Can I set Qt so that console is used while I debug. Or is there some feature under Qt debbuger that allow for something similar or maybe something better.

I would appreciate any advice you can give me. If I have been unclear about something tell me and I will try to clarify.

Thanks in advance.

Boron
1st September 2009, 12:06
1. Yes you can, but you are not allowed to. As soon as you want to link a LGPL library into you program statically you also have to release your program under the LGPL.
If you want keep your source closed you have to link dynamically (see 3.)

--> If someone has better understanding of this license puzzle correct me.

2. Of course start it from the start menu :).

3. As long as you will not release your applications to anyone outside your office you don't have to worry about licensing.
If there is the chance that your apps will be used by others than you and your colleagues you can (since Qt 4.5) just release your apps under the LGPL. You can keep the source code closed, but you must link dynamically to Qt, so that the Qt libs can be replaced.

4. As you can see here: http://qt.nokia.com/doc/4.5/modules.html Qt consists of many modules. QtGui is just one of them. Some others are related to a GUI or depend on a GUI. But many can easily be used on console applications.

5. I never tried it but this may help: http://qt.nokia.com/doc/4.5/qtglobal.html#qDebug

frenk_castle
1st September 2009, 12:37
Thanks for the swift reply.

Console is not than important when program is finished I am just used to using it during development. I would not be surprised if Qt has some debugging feature that is similar. I will read on that on the net.

I have just one question concerning your answer. What "release your program under the LGPL" exactly means. I don't need static linking to hide anything it is just easier to give my colleges just one exe file rather that exe file and dll but is not that of a bother. But if I decide to develop some software later when I learn more of Qt I need to know what releasing under LGPL means. I read some articles concerning LGPL but I am still not clear on that.

Boron
1st September 2009, 13:12
Me neither.
I think to understand what these licenses really mean you have to be a lawyer.
This is just what I was told when I had a similar question in February.

Let me have a look...
Here it is: http://www.qtcentre.org/forum/f-installation-and-deployment-5/t-which-qt-license-needed-for-in-house-tools-19133.html
OK, LGPL was only mentioned once. So forget about (L)GPL.
Link statically and deploy just the executable. Keep your app in-house and everything is OK :).

This is even more interesting: http://www.qtcentre.org/forum/f-installation-and-deployment-5/t-lglpl-licensing-for-commercial-application-23511.html/?highlight=LGPL