PDA

View Full Version : Porting 4.4.2 to 4.7.0



Lee B
18th October 2010, 16:24
Hi,

We have an application that has been developed using C++ and Qt 4.4.2 Commercial under Visual Studio 2008.

I have installed the latest version of Qt (4.7.0 LGPL and Commercial). When I create a new Qt project in VS2008, the new code compiles with no problem, so there is nothing wrong with the installation itself.

My aim has been to port the application written in QT 4.4.2 to QT 4.7.0. However, after importing the code, the code fails to compile with multiple compilation issues.

Could anyone advise why this may be happening, or point me to any QT resources that may help with porting older QT code to the latest version?

If an older system is written with a commercial release, does that prohibit porting the system to a later LGPL version?

Cheers,
Lee.

tbscope
18th October 2010, 16:28
Could anyone advise why this may be happening, or point me to any QT resources that may help with porting older QT code to the latest version?

Can you post the error messages please?

As far as I know, Qt 4.x code should work over the whole line of Qt 4.x libraries (backwards that is)

gboelter
18th October 2010, 17:07
Hi Lee,


My aim has been to port the application written in QT 4.4.2 to QT 4.7.0. However, after importing the code, the code fails to compile with multiple compilation issues.

I had similar problems too in the past. So, if you don't have a better idea and the project is important for you, do it step by step.

Here you can get the old versions of Qt: http://download.qt.nokia.com/qt/source

Try to convert it from 4,4.2 to - let's say - 4.5 and then to 4.6 and so on.

Yes, I know, it's a heavy job ...

Lykurg
18th October 2010, 17:31
If an older system is written with a commercial release, does that prohibit porting the system to a later LGPL version? This way it is no problem. But if you want to change from LGPL to commercial there are some "difficulties".


Try to convert it from 4,4.2 to - let's say - 4.5 and then to 4.6 and so on.Yeah, and don't forget to convert it first to Python, then Java, from there to Basic and then back to Qt. Seriously why do you want to do more work by stepping through older releases? That doesn't make sense. Just target 4.7 straight forward. The errors probably only because of some API changes which could be cleaned by some search&replace.

wysota
18th October 2010, 17:59
I have installed the latest version of Qt (4.7.0 LGPL and Commercial).
Based on MinGW or Visual Studio?


However, after importing the code, the code fails to compile with multiple compilation issues.
After "importing" it where?


Could anyone advise why this may be happening, or point me to any QT resources that may help with porting older QT code to the latest version?
You shouldn't need to port anything. 4.7 is compatible with 4.4 on the source code level.


If an older system is written with a commercial release, does that prohibit porting the system to a later LGPL version?
You can switch between LGPL/commercial freely (both ways). This wasn't the case when Qt was GPL, then Trolls were getting angry if someone was switching from GPL to commercial.

gboelter
18th October 2010, 18:01
Yeah, and don't forget to convert it first to Python, then Java, from there to Basic and then back to Qt. Seriously why do you want to do more work by stepping through older releases? That doesn't make sense. Just target 4.7 straight forward. The errors probably only because of some API changes which could be cleaned by some search&replace.
Lykurg, I know that you are good, but Lee is a beginner in Qt. If there are to many error-messages, that's very frustrating for a beginner.

So, what's wrong in doing it step by step if the project is really important for him?

I had a similar problem just a few weeks ago. To compile my source with 4.7 instead 4.6.3 was now problem under Linux. Under windows I got many error-messages.

wysota
18th October 2010, 18:38
So, what's wrong in doing it step by step if the project is really important for him?
Apart from doing the same thing 10 times? Nothing, I guess. If you have a couple of evenings to spare with nothing better to do then go ahead.

The errors OP is getting are probably unrelated to the version change at all. Most likely there are some stale files in the project directory, the compiler or the environment (as in available libraries and stuff) have been changed by the project developer. In times such as this people tend to forget they installed/uninstalled/reinstalled/modified something in their system and/or project source code.

Lykurg
18th October 2010, 18:43
You can switch between LGPL/commercial freely (both ways). This wasn't the case when Qt was GPL, then Trolls were getting angry if someone was switching from GPL to commercial.Damn, yes you are right, it was about GPL. It's nice to heare that they have no trouble with LGPL/comercial switches.

gboelter
18th October 2010, 19:05
The errors OP is getting are probably unrelated to the version change at all. Most likely there are some stale files in the project directory, the compiler or the environment (as in available libraries and stuff) have been changed by the project developer. In times such as this people tend to forget they installed/uninstalled/reinstalled/modified something in their system and/or project source code.
May be, may be not! I have not seen any error messages from Lee until now.

What's going on here? From what I understand, he has an application it's developed under Qt 4.4.2 and while trying to compile it under 4.7.0, he got many errors. So, what's wrong to install Qt 4.4.2 and compile the programm with that?

Later on he can try to compile it with a newer version of Qt ...

wysota
18th October 2010, 19:20
May be, may be not!
Maybe they are related to the phase of the current that happened to be flowing through the power socket when he clicked the build button...


I have not seen any error messages from Lee until now.
Qt 4.7 is source-compatible with Qt 4.4.

So, what's wrong to install Qt 4.4.2 and compile the programm with that?
1. time/money spent downloading/installing/setting up Qt 4.4.2
2. no progress - he wants to build the application with 4.7 and not 4.4.
3. no relation between getting things to build with 4.4 and 4.7 - even if it builds against 4.4, it doesn't mean 4.7 incompatibility is to "blame", for example if you make some stupid mistake each time you install 4.7, the fact that your 4.4 installation works correctly will get you nowhere if you keep repeating the same mistake during each and every install of 4.7.

And between 4.4 there were also 4.5 and 4.6 and releases of each of the minor versions. This gives well over 10 installations you need to perform just to click one "build" button to see nothing has changed since the previous release.

Lee B
18th October 2010, 20:20
Hi,

Thanks to everyone who has posted replies. The information given has been very helpful and thought provoking, and I will follow up the various strategies you have suggested to get the application running.
I am unable to post the exact error messages etc at the moment due to being away from the office. I will look at trying some of your ideas as soon as I get back.

Thanks again,
Lee.