View Full Version : qapplication error when -DQT3_SUPPORT option

27th June 2006, 12:40
Hi all,
I'm porting a linux qt3 app to win2000 qt4.1.4(opensource).
I use qt3to4 to change my sources files and when trying to compile I got the following error :

In file included from /cygdrive/c/QT/4.1.4/include/Qt/qapplication.h:1,
from main.cpp:3:
/cygdrive/c/QT/4.1.4/include/Qt/../../src/gui/kernel/qapplication.h:254: error: ISO C++ forbids declaration of `WindowsV
ersion' with no type
/cygdrive/c/QT/4.1.4/include/Qt/../../src/gui/kernel/qapplication.h:254: error: invalid use of `::'
/cygdrive/c/QT/4.1.4/include/Qt/../../src/gui/kernel/qapplication.h:254: error: expected `;' before "winVersion"
/cygdrive/c/QT/4.1.4/include/Qt/../../src/gui/kernel/qapplication.h:259: error: expected `;' before "inline"
make[2]: *** [main.o] Error 1

a quick look in qapplication.h gives :

#if defined(Q_OS_WIN32) || defined(Q_OS_CYGWIN)
static QT3_SUPPORT Qt::WindowsVersion winVersion() { return (Qt::WindowsVersion)QSysInfo::WindowsVersion; }

All of these seems to be correct so what happens ?
Why is WindowsVersion in Qt not recognize ?

Did so had such problems or any idea ?
Thx alot !

28th June 2006, 13:13
It looks like you miss some file included (declaring something with no type)... Could you post the include statements ?

28th June 2006, 14:43
the "declaring with no type" is in qapplication.h from qt !!!!!
that some WindowsVersion is not found is namespace Qt.
That looks like internal problem (only happens when you set qt3 support).
Is there anyone who compiled sth successfuly with this option ?

$ make AM_LDFLAGS="-L/cygdrive/c/workStephane/ACE_wrappers/lib -llibACE -L/cygdrive/c/QT/4.1.4/bin -lQt3Support4 -lQtCore4 -lQtGui4" AM_CPPFLAGS="-I/cygdrive/c/workStephane/ACE_wrappers -I/cygdrive/c/QT/4.1.4/include -I/cygdrive/c/QT/4.1.4/include/Qt -I/cygdrive/c/QT/4.1.4/include/Qt3Support -I/cygdrive/c/QT/4.1.4/include/QtGui -DQT3_SUPPORT"

Notice: I use AM_ in order to dont change my linux make system

28th June 2006, 15:10
Could you post main.cpp:3 ?