Qt programming, bugs in first programming
Hi,
In chapter 17. Qt programming, the first programm contains bugs.
#include <qapplication.h>
#include <qmainwindow.h>
int main(int argc, char **argv)
{
QApplication app(argc, argv);
QMainWindow window(); /* Here is bug. it should
'QMainWindow window;' */
app.setMainWidget(window); /* Here is bug. it should be
'app.setMainWidget(&window);' */
window.show();
return app.exec();
}
i am using qt-3.3 version. and it didnot have any library naming 'libqt'. insted it has 'libqt-mt' library. so i have to change the library name in command to compile application.
> g++ -o qtl qtl.cpp -I$QTDIR/include -L$QTDIR/lib -lqt
Here i changed -lqt (as given in book) to -lqt-mt, then it worked.
regards,
sateeshgalla.
|