problem compiling QT3 app (cygwin)

Joe Moore squanto at
Thu Aug 19 06:07:55 CEST 2004

I am having a problem compiling a basic QT app under the current Cygwin 

// Begin qt1.cpp

#include <qapplication.h>
#include <qmainwindow.h>

int main(int argc, char **argv)
  QApplication app(argc, argv);
  QMainWindow window();
  return app.exec();

// end 

I used the following command line to compile:

g++ -o qt1 qt1.cpp -I$QTDIR/include -L$QTDIR/lib -lqt

I got back the following .. 

qt1.cpp: In function `int main(int, char**)':
qt1.cpp:9: error: no matching function for call to `QApplication::setMainWidget
   (QMainWindow (&)())'
/opt/qt/3.2/include/qapplication.h:120: error: candidates are: virtual void
qt1.cpp:10: error: request for member `show' in `window', which is of
   non-aggregate type `QMainWindow ()()'

Am I missing something? 

More information about the kde-cygwin mailing list