Please Help me How to install QT on VC++ 2008
-
yes exactly . 1) i install qt-win 2) install qt vs add in 3) create qt application with qt addin 4)push F7(build solution)
Errors:
Warning 2 warning C4273: 'staticQtMetaObject' : inconsistent dll linkage c:\Users\AhUrA\Documents\Visual Studio 2008\Projects\Qt\Qt\GeneratedFiles\Debug\moc_qt.cpp 41
Error 7 fatal error C1903: unable to recover from previous error(s); stopping compilation c:\Users\AhUrA\Documents\Visual Studio 2008\Projects\Qt\Qt\qt.cpp 4
Error 6 error C4430: missing type specifier - int assumed. Note: C++ does not support default-int c:\Users\AhUrA\Documents\Visual Studio 2008\Projects\Qt\Qt\qt.cpp 4
Error 9 error C2882: 'Qt' : illegal use of namespace identifier in expression c:\Users\AhUrA\Documents\Visual Studio 2008\Projects\Qt\Qt\main.cpp 7
Error 1 error C2869: 'Qt' : has already been defined to be a namespace c:\users\ahura\documents\visual studio 2008\projects\qt\qt\qt.h 7
Error 4 error C2869: 'Qt' : has already been defined to be a namespace c:\users\ahura\documents\visual studio 2008\projects\qt\qt\qt.h 7
Error 8 error C2869: 'Qt' : has already been defined to be a namespace c:\users\ahura\documents\visual studio 2008\projects\qt\qt\qt.h 7
Error 3 error C2491: 'QObject::staticQtMetaObject' : definition of dllimport static data member not allowed c:\Users\AhUrA\Documents\Visual Studio 2008\Projects\Qt\Qt\GeneratedFiles\Debug\moc_qt.cpp 41
Error 13 error C2228: left of '.show' must have class/struct/union c:\Users\AhUrA\Documents\Visual Studio 2008\Projects\Qt\Qt\main.cpp 8
Error 10 error C2146: syntax error : missing ';' before identifier 'w' c:\Users\AhUrA\Documents\Visual Studio 2008\Projects\Qt\Qt\main.cpp 7
Error 11 error C2065: 'w' : undeclared identifier c:\Users\AhUrA\Documents\Visual Studio 2008\Projects\Qt\Qt\main.cpp 7
Error 12 error C2065: 'w' : undeclared identifier c:\Users\AhUrA\Documents\Visual Studio 2008\Projects\Qt\Qt\main.cpp 8
Error 5 error C2039: 'Qt' : is not a member of 'Qt' c:\Users\AhUrA\Documents\Visual Studio 2008\Projects\Qt\Qt\qt.cpp 3 -
@
#ifndef QT_H
#define QT_H#include <QtGui/QMainWindow>
#include "ui_qt.h"class Qt : public QMainWindow
{
Q_OBJECTpublic:
Qt(QWidget *parent = 0, Qt::WFlags flags = 0);
~Qt();private:
Ui::QtClass ui;
};#endif // QT_H
@@#include "qt.h"
Qt::Qt(QWidget *parent, Qt::WFlags flags)
: QMainWindow(parent, flags)
{
ui.setupUi(this);
}Qt::~Qt()
{}
@@#include "qt.h"
#include <QtGui/QApplication>int main(int argc, char *argv[])
{
QApplication a(argc, argv);
Qt w;
w.show();
return a.exec();
}
@ -
First, please be more patiently. We all do the support here in our spare time and as volunteers. If your topic has that much answers, someone will surely come back with an answer.
As others already have mentioned, do not name your class Qt! This will conflict with the Qt namespace in the Qt libs itself. Additionally, it's good practice to not prefix your own classes with Q or Qt, as this is informally reserved for Qt's own classes.
-
you can get it from http://qt.nokia.com/downloads/downloads#qt-lib
-
[quote author="cincirin" date="1323286429"]Try to rename your files. From what I see you have Qt.cpp and Qt.h in your project. And don't use only Qt in your namespaces or class definitions or other defined type.[/quote]
[quote author="Volker" date="1323301857"]As others already have mentioned, do not name your class Qt! This will conflict with the Qt namespace in the Qt libs itself. Additionally, it's good practice to not prefix your own classes with Q or Qt, as this is informally reserved for Qt's own classes.[/quote]
You have made these changes ? If yes, you still have errors ? If yes, please post new code with the changes.