Qt-interest Archive, July 2007
problem while porting from Qt3 Lin to Qt4 Win
Message 1 in thread
I use Qt3 on Linux Deb Etch and Qt4.3 on WinXPSP2.
Small project developed for Qt3 Linux needs be ported to Qt4 Windows. Using
MinGW and Dev C++ I've got first good results - all Qt4 demos and examples
were recompiled and able for debugging in Dev C++.
Then I started porting. First small application including 4 source files
without GUI was not a problem - I've run qt3to4 for entire project. Just
included proper header files and libraries to proj properties in DevC++ -
and I got working .exe in release folder.
But while compiling second .exe I've got tons of errors - all in Qt3 support
header files. All about Qt classes:
[code]
45 c:\Qt\4.3.0\src\qt3support\widgets\q3toolbar.h `Qt::ToolBarDock' has not
been declared
45 c:\Qt\4.3.0\src\qt3support\widgets\q3toolbar.h `DockTop' is not a member
of `Qt'
...
81 C:\Qt\4.3.0\src\qt3support\widgets\q3mainwindow.h `Qt::Dock' has not been
declared
81 C:\Qt\4.3.0\src\qt3support\widgets\q3mainwindow.h ISO C++ forbids
declaration of `parameter' with no type
...
C:\Qt\4.3.0\src\qt3support\widgets\q3popupmenu.h In member function `int
Q3PopupMenu::exec()':
40 C:\Qt\4.3.0\src\qt3support\widgets\q3popupmenu.h `findIdForAction'
undeclared (first use this function)
[/code]
and so on. Hundreeds of errors all in qt3...h files.
Looks like qt3to4 did not all work for me. This does not depend from DevC++.
I see same after make from console. Then what is the way to port from Qt3 to
4.3...? I need solution cause I have port not only to Qt4 Win but to Qt4 Lin
too and then use Qwt library.
Serge.
--
[ signature omitted ]
Message 2 in thread
Make sure your project has the QT += qt3support flag set
Scott
> -----Original Message-----
> From: nilir@xxxxxxxx [mailto:nilir@xxxxxxxx]
> Sent: Friday, July 20, 2007 8:21 AM
> To: qt-interest@xxxxxxxxxxxxx
> Subject: problem while porting from Qt3 Lin to Qt4 Win
>
> I use Qt3 on Linux Deb Etch and Qt4.3 on WinXPSP2.
>
> Small project developed for Qt3 Linux needs be ported to Qt4 Windows.
> Using
> MinGW and Dev C++ I've got first good results - all Qt4 demos and
examples
> were recompiled and able for debugging in Dev C++.
>
> Then I started porting. First small application including 4 source
files
> without GUI was not a problem - I've run qt3to4 for entire project.
Just
> included proper header files and libraries to proj properties in
DevC++ -
> and I got working .exe in release folder.
>
> But while compiling second .exe I've got tons of errors - all in Qt3
> support
> header files. All about Qt classes:
>
> [code]
> 45 c:\Qt\4.3.0\src\qt3support\widgets\q3toolbar.h `Qt::ToolBarDock'
has
> not
> been declared
> 45 c:\Qt\4.3.0\src\qt3support\widgets\q3toolbar.h `DockTop' is not a
> member
> of `Qt'
> ...
> 81 C:\Qt\4.3.0\src\qt3support\widgets\q3mainwindow.h `Qt::Dock' has
not
> been
> declared
> 81 C:\Qt\4.3.0\src\qt3support\widgets\q3mainwindow.h ISO C++ forbids
> declaration of `parameter' with no type
> ...
> C:\Qt\4.3.0\src\qt3support\widgets\q3popupmenu.h In member function
`int
> Q3PopupMenu::exec()':
> 40 C:\Qt\4.3.0\src\qt3support\widgets\q3popupmenu.h `findIdForAction'
> undeclared (first use this function)
> [/code]
>
> and so on. Hundreeds of errors all in qt3...h files.
>
> Looks like qt3to4 did not all work for me. This does not depend from
> DevC++.
> I see same after make from console. Then what is the way to port from
Qt3
> to
> 4.3...? I need solution cause I have port not only to Qt4 Win but to
Qt4
> Lin
> too and then use Qwt library.
>
> Serge.
>
>
>
>
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with
> "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
--
[ signature omitted ]
Message 3 in thread
A-ha... I didn't notice that qmake -project creates new .pro and kills that
key in my .pro file.
Thanx.
"Scott Aron Bloom" <scott@xxxxxxxxxxxx> ???????/???????? ? ????????
?????????:
news:E2E5EA152B64E044B464DA705AF44AAE04F7D0@xxxxxxxxxxxxxxxxxxxxxx
Make sure your project has the QT += qt3support flag set
Scott
> -----Original Message-----
> From: nilir@xxxxxxxx [mailto:nilir@xxxxxxxx]
> Sent: Friday, July 20, 2007 8:21 AM
> To: qt-interest@xxxxxxxxxxxxx
> Subject: problem while porting from Qt3 Lin to Qt4 Win
>
> I use Qt3 on Linux Deb Etch and Qt4.3 on WinXPSP2.
>
> Small project developed for Qt3 Linux needs be ported to Qt4 Windows.
> Using
> MinGW and Dev C++ I've got first good results - all Qt4 demos and
examples
> were recompiled and able for debugging in Dev C++.
>
> Then I started porting. First small application including 4 source
files
> without GUI was not a problem - I've run qt3to4 for entire project.
Just
> included proper header files and libraries to proj properties in
DevC++ -
> and I got working .exe in release folder.
>
> But while compiling second .exe I've got tons of errors - all in Qt3
> support
> header files. All about Qt classes:
>
> [code]
> 45 c:\Qt\4.3.0\src\qt3support\widgets\q3toolbar.h `Qt::ToolBarDock'
has
> not
> been declared
> 45 c:\Qt\4.3.0\src\qt3support\widgets\q3toolbar.h `DockTop' is not a
> member
> of `Qt'
> ...
> 81 C:\Qt\4.3.0\src\qt3support\widgets\q3mainwindow.h `Qt::Dock' has
not
> been
> declared
> 81 C:\Qt\4.3.0\src\qt3support\widgets\q3mainwindow.h ISO C++ forbids
> declaration of `parameter' with no type
> ...
> C:\Qt\4.3.0\src\qt3support\widgets\q3popupmenu.h In member function
`int
> Q3PopupMenu::exec()':
> 40 C:\Qt\4.3.0\src\qt3support\widgets\q3popupmenu.h `findIdForAction'
> undeclared (first use this function)
> [/code]
>
> and so on. Hundreeds of errors all in qt3...h files.
>
> Looks like qt3to4 did not all work for me. This does not depend from
> DevC++.
> I see same after make from console. Then what is the way to port from
Qt3
> to
> 4.3...? I need solution cause I have port not only to Qt4 Win but to
Qt4
> Lin
> too and then use Qwt library.
>
> Serge.
>
>
>
>
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with
> "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
--
[ signature omitted ]
Message 4 in thread
came through those errors, application created
but another problem appeared: after run from console I see command prompt,
but application remains in memory and nothig more happiness - but some
messages ought be printed to stdout
I reduced main code to following:
#include <qapplication.h>
#include <qlabel.h>
//#include "kernel.h"
int main(int argc, char** argv)
{
//QApplication application(argc, argv);
printf("kernelRun();\n");
/*
kernelRun(&application);
QObject::connect(&application, SIGNAL(lastWindowClosed()),
&application, SLOT(quit()));
printf("\napplication.exec();\n");
return application.exec();
*/
printf("\n - THE END - \n \n");
}
but I don't see any printf... what's a problem can be?
another question - when qt3to4 has to be ran? I run it before qmake, is that
right?
<nilir@xxxxxxxx> ÓÏÏÂÝÉÌ/ÓÏÏÂÝÉÌÁ × ÎÏ×ÏÓÔÑÈ ÓÌÅÄÕÀÝÅÅ:
news:f81ros$62q$1@xxxxxxxxxxxxxxxxxxxxx
> A-ha... I didn't notice that qmake -project creates new .pro and kills
> that key in my .pro file.
> Thanx.
>
> "Scott Aron Bloom" <scott@xxxxxxxxxxxx> ???????/???????? ? ????????
> ?????????:
> news:E2E5EA152B64E044B464DA705AF44AAE04F7D0@xxxxxxxxxxxxxxxxxxxxxx
> Make sure your project has the QT += qt3support flag set
>
> Scott
>
>> -----Original Message-----
>> From: nilir@xxxxxxxx [mailto:nilir@xxxxxxxx]
>> Sent: Friday, July 20, 2007 8:21 AM
>> To: qt-interest@xxxxxxxxxxxxx
>> Subject: problem while porting from Qt3 Lin to Qt4 Win
>>
>> I use Qt3 on Linux Deb Etch and Qt4.3 on WinXPSP2.
>>
>> Small project developed for Qt3 Linux needs be ported to Qt4 Windows.
>> Using
>> MinGW and Dev C++ I've got first good results - all Qt4 demos and
> examples
>> were recompiled and able for debugging in Dev C++.
>>
>> Then I started porting. First small application including 4 source
> files
>> without GUI was not a problem - I've run qt3to4 for entire project.
> Just
>> included proper header files and libraries to proj properties in
> DevC++ -
>> and I got working .exe in release folder.
>>
>> But while compiling second .exe I've got tons of errors - all in Qt3
>> support
>> header files. All about Qt classes:
>>
>> [code]
>> 45 c:\Qt\4.3.0\src\qt3support\widgets\q3toolbar.h `Qt::ToolBarDock'
> has
>> not
>> been declared
>> 45 c:\Qt\4.3.0\src\qt3support\widgets\q3toolbar.h `DockTop' is not a
>> member
>> of `Qt'
>> ...
>> 81 C:\Qt\4.3.0\src\qt3support\widgets\q3mainwindow.h `Qt::Dock' has
> not
>> been
>> declared
>> 81 C:\Qt\4.3.0\src\qt3support\widgets\q3mainwindow.h ISO C++ forbids
>> declaration of `parameter' with no type
>> ...
>> C:\Qt\4.3.0\src\qt3support\widgets\q3popupmenu.h In member function
> `int
>> Q3PopupMenu::exec()':
>> 40 C:\Qt\4.3.0\src\qt3support\widgets\q3popupmenu.h `findIdForAction'
>> undeclared (first use this function)
>> [/code]
>>
>> and so on. Hundreeds of errors all in qt3...h files.
>>
>> Looks like qt3to4 did not all work for me. This does not depend from
>> DevC++.
>> I see same after make from console. Then what is the way to port from
> Qt3
>> to
>> 4.3...? I need solution cause I have port not only to Qt4 Win but to
> Qt4
>> Lin
>> too and then use Qwt library.
>>
>> Serge.
>>
>>
>>
>>
>> --
>> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with
>> "unsubscribe" in the subject or the body.
>> List archive and information: http://lists.trolltech.com/qt-interest/
>
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with
> "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
>
--
[ signature omitted ]
Message 5 in thread
On 7/23/07, nilir@xxxxxxxx <nilir@xxxxxxxx> wrote:
>
> came through those errors, application created
>
> but another problem appeared: after run from console I see command prompt,
> but application remains in memory and nothig more happiness - but some
> messages ought be printed to stdout
>
> I reduced main code to following:
>
> #include <qapplication.h>
> #include <qlabel.h>
>
> //#include "kernel.h"
>
>
> int main(int argc, char** argv)
> {
> //QApplication application(argc, argv);
>
> printf("kernelRun();\n");
> /*
> kernelRun(&application);
>
> QObject::connect(&application, SIGNAL(lastWindowClosed()),
> &application, SLOT(quit()));
>
> printf("\napplication.exec();\n");
>
> return application.exec();
> */
> printf("\n - THE END - \n \n");
> }
>
> but I don't see any printf... what's a problem can be?
I ran your code with Qt 4.3.0 on Linux, and it worked fine for me.
another question - when qt3to4 has to be ran? I run it before qmake, is that
> right?
I believe that is correct. qt3to4 modifies your source files to replace
obsolete Qt 3 calls with their equivalent Qt 4 calls.
As a side note, you say that you are converting a project from Qt 3 on Linux
to Qt 4 on Windows. I would do this in two separate steps: switch operating
systems and then switch Qt versions, or do it the other way around. Going
from Qt 3 to Qt 4 is not trivial. Although Qt should make switching
operating systems fairly easy, you're going to be dealing with a different
build environment which will cause you headaches if you're simultaneously
converting to Qt 4 because you won't know which is the cause of compilation
errors.
Tom
Message 6 in thread
that would be good idea if only I have Qt3.3 for Win
but I looked at TrollTech ftp with old versions - first time I thought damn... too many files from different versions
now I cannot open ftp://ftp.trolltech.com/qt/source at all :-\
As a side note, you say that you are converting a project from Qt 3 on Linux to Qt 4 on Windows. I would do this in two separate steps: switch operating systems and then switch Qt versions, or do it the other way around.
Tom
Message 7 in thread
On 24.07.07 13:07:32, nilir@xxxxxxxx wrote:
> that would be good idea if only I have Qt3.3 for Win
Well, then first do the switch to Qt4 (using linux as OS) and then when
its done switch to win32.
Andreas
--
[ signature omitted ]
Message 8 in thread
bother cause all works! :)
almost all - some widgets behavior are little different, for example -
subwindows in MDI open zoomed but dont' have minimize-close buttons by
default (in Qt3 build they were)
and I still cannot debug this thing... it consists of one main application
kernel.exe and several plugins (.so in Linux and .lib in Win) - plugins are
different project in Dev C++, they are placed in different folders and qdb
cannot access to their source code - looks like this is a problem of Dev C++
but I did porting from Qt3 Lin to Qt4 Win using MinGW and Dev C++ he-he...
thanx for all help!
thinking about write step by step description "how to port application from
Qt3 Lin to Qt4 Win" - will this helpful for somebody else?
"Andreas Pakulat" <apaku@xxxxxx> ???????/???????? ? ???????? ?????????:
news:20070724103106.GB3007@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> On 24.07.07 13:07:32, nilir@xxxxxxxx wrote:
>> that would be good idea if only I have Qt3.3 for Win
>
> Well, then first do the switch to Qt4 (using linux as OS) and then when
> its done switch to win32.
>
> Andreas
>
> --
> You worry too much about your job. Stop it. You are not paid enough to
> worry.
>
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with
> "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
--
[ signature omitted ]
Message 9 in thread
<nilir@xxxxxxxx> ÓÏÏÂÝÉÌ/ÓÏÏÂÝÉÌÁ × ÎÏ×ÏÓÔÑÈ ÓÌÅÄÕÀÝÅÅ:
news:f875id$ptm$1@xxxxxxxxxxxxxxxxxxxxx
> kernel.exe and several plugins (.so in Linux and .lib in Win) - plugins
> are
sorry .dll in Win of course
--
[ signature omitted ]
Message 10 in thread
You only run qt3to4 once.
Then you use the source generated as your new source tree.
Also, instead of printf, try qDebug, and run it from a debugger.
Another thing, make sure you have qt += console
Windows consoles are quite different then linux
Scott
> -----Original Message-----
> From: nilir@xxxxxxxx [mailto:nilir@xxxxxxxx]
> Sent: Monday, July 23, 2007 4:49 AM
> To: qt-interest@xxxxxxxxxxxxx
> Subject: Re: problem while porting from Qt3 Lin to Qt4 Win
>
> came through those errors, application created
>
> but another problem appeared: after run from console I see command prompt,
> but application remains in memory and nothig more happiness - but some
> messages ought be printed to stdout
>
> I reduced main code to following:
>
> #include <qapplication.h>
> #include <qlabel.h>
>
> //#include "kernel.h"
>
>
> int main(int argc, char** argv)
> {
> //QApplication application(argc, argv);
>
> printf("kernelRun();\n");
> /*
> kernelRun(&application);
>
> QObject::connect(&application, SIGNAL(lastWindowClosed()),
> &application, SLOT(quit()));
>
> printf("\napplication.exec();\n");
>
> return application.exec();
> */
> printf("\n - THE END - \n \n");
> }
>
> but I don't see any printf... what's a problem can be?
>
> another question - when qt3to4 has to be ran? I run it before qmake, is
> that
> right?
>
> <nilir@xxxxxxxx> ÓÏÏÂÝÉÌ/ÓÏÏÂÝÉÌÁ × ÎÏ×ÏÓÔÑÈ ÓÌÅÄÕÀÝÅÅ:
> news:f81ros$62q$1@xxxxxxxxxxxxxxxxxxxxx
> > A-ha... I didn't notice that qmake -project creates new .pro and kills
> > that key in my .pro file.
> > Thanx.
> >
> > "Scott Aron Bloom" <scott@xxxxxxxxxxxx> ???????/???????? ? ????????
> > ?????????:
> > news:E2E5EA152B64E044B464DA705AF44AAE04F7D0@xxxxxxxxxxxxxxxxxxxxxx
> > Make sure your project has the QT += qt3support flag set
> >
> > Scott
> >
> >> -----Original Message-----
> >> From: nilir@xxxxxxxx [mailto:nilir@xxxxxxxx]
> >> Sent: Friday, July 20, 2007 8:21 AM
> >> To: qt-interest@xxxxxxxxxxxxx
> >> Subject: problem while porting from Qt3 Lin to Qt4 Win
> >>
> >> I use Qt3 on Linux Deb Etch and Qt4.3 on WinXPSP2.
> >>
> >> Small project developed for Qt3 Linux needs be ported to Qt4 Windows.
> >> Using
> >> MinGW and Dev C++ I've got first good results - all Qt4 demos and
> > examples
> >> were recompiled and able for debugging in Dev C++.
> >>
> >> Then I started porting. First small application including 4 source
> > files
> >> without GUI was not a problem - I've run qt3to4 for entire project.
> > Just
> >> included proper header files and libraries to proj properties in
> > DevC++ -
> >> and I got working .exe in release folder.
> >>
> >> But while compiling second .exe I've got tons of errors - all in Qt3
> >> support
> >> header files. All about Qt classes:
> >>
> >> [code]
> >> 45 c:\Qt\4.3.0\src\qt3support\widgets\q3toolbar.h `Qt::ToolBarDock'
> > has
> >> not
> >> been declared
> >> 45 c:\Qt\4.3.0\src\qt3support\widgets\q3toolbar.h `DockTop' is not a
> >> member
> >> of `Qt'
> >> ...
> >> 81 C:\Qt\4.3.0\src\qt3support\widgets\q3mainwindow.h `Qt::Dock' has
> > not
> >> been
> >> declared
> >> 81 C:\Qt\4.3.0\src\qt3support\widgets\q3mainwindow.h ISO C++ forbids
> >> declaration of `parameter' with no type
> >> ...
> >> C:\Qt\4.3.0\src\qt3support\widgets\q3popupmenu.h In member function
> > `int
> >> Q3PopupMenu::exec()':
> >> 40 C:\Qt\4.3.0\src\qt3support\widgets\q3popupmenu.h `findIdForAction'
> >> undeclared (first use this function)
> >> [/code]
> >>
> >> and so on. Hundreeds of errors all in qt3...h files.
> >>
> >> Looks like qt3to4 did not all work for me. This does not depend from
> >> DevC++.
> >> I see same after make from console. Then what is the way to port from
> > Qt3
> >> to
> >> 4.3...? I need solution cause I have port not only to Qt4 Win but to
> > Qt4
> >> Lin
> >> too and then use Qwt library.
> >>
> >> Serge.
> >>
> >>
> >>
> >>
> >> --
> >> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with
> >> "unsubscribe" in the subject or the body.
> >> List archive and information: http://lists.trolltech.com/qt-interest/
> >
> > --
> > To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with
> > "unsubscribe" in the subject or the body.
> > List archive and information: http://lists.trolltech.com/qt-interest/
> >
>
>
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with
> "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
--
[ signature omitted ]
Message 11 in thread
>
> printf("\n - THE END - \n \n");
> }
>
> but I don't see any printf... what's a problem can be?
IIRC, on Windows, you have to have "console" in CONFIG in your .pro file:
CONFIG += console
P-E
--
[ signature omitted ]
Message 12 in thread
added console to CONFIG += section and added qt += console at the end of project file
I'm not sure are both keys mandatory or only one needed...
exe file cannot be linked, an error appeared:
[Linker error] undefined reference to `WinMain@16'
"Pierre-Étienne Messier" <pierre.etienne.messier@xxxxxxxxx> ???????/???????? ? ???????? ?????????: news:50ec55860707230811t5f8815f1tb55be9dafa6bdb75@xxxxxxxxxxxxxxxxx
printf("\n - THE END - \n \n");
}
but I don't see any printf... what's a problem can be?
IIRC, on Windows, you have to have "console" in CONFIG in your .pro file:
CONFIG += console
P-E
--
Pierre-Étienne Messier
Courriel : pierre.etienne.messier@xxxxxxxxx
OpenPGP ID : 1024D/9BDBDDF6
Web : http://pemessier.hexpresso.org/
Jabber : SiLiZiUMM@xxxxxxxxxx