I have created simple test project that uses QT3 gui. The main function is as follows:
int main(int argc, char** argv)
{
QApplication a(atgc, argv);
MainWindow *w = new MainWindow;
w->show();
a.setMainWidget(w);
a.exec();
if(w) delete w;
return 0;
}
When I compile it like this:
qmake
make
it is ok (the used compiler is g++-2.95.4). But when I do this:
qmake
make CXX=g++-3.3.6 LINK=g++-3.3.6
I get tons of link errors like this:
.obj/main.o(.text+0x27): In function `main':
: undefined reference to `QApplication::QApplication[in-charge](int&, char**)'
.obj/main.o(.text+0x66): In function `main':
: undefined reference to `QApplication::setMainWidget(QWidget*)'
.obj/main.o(.text+0x6e): In function `main':
: undefined reference to `QApplication::exec()'
It seems like it has not linked qt libraries properly. Is there any idea how to build project using any other compiler? I am using linux RedHat.