problem compiling QT3 app (cygwin)

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


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

// Begin qt1.cpp



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

int main(int argc, char **argv)
{
  QApplication app(argc, argv);
  QMainWindow window();
  app.setMainWidget(window);
  window.show();
  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
   QApplication::setMainWidget(QWidget*)
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