I am trying to use Qt 4.0 with devCpp.

I have a weird error when i try to compile this simple code :

#include <QtGui/QApplication>

int main(int argc, char *argv[])
	QApplication qApp(argc, argv);
    return qApp.exec();

The error is :

10 : no matching function for call to QApplication::QApplication(QApplication*)' 
10 : note : candidates are : 
      note : QApplication::QApplication(int&, char**)

I've never seen that before ! where does it come from ?!

Re: Qt4 and devcpp 80 80

You had me pretty confused on this one. It seems like qApp is a macro or something (reserved word).

I changed it to:

QApplication a(argc, argv);
return a.exec();

and then it worked fine.


Re: Qt4 and devcpp 80 80

I'm pretty sure it has to be like this:

QApplication qApp(&argc, &argv);

Ooops, got GTK+ mixed up with QT4.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.