Please Help me How to install QT on VC++ 2008
-
wrote on 7 Dec 2011, 16:37 last edited by
my windows is windows 7 64 bit and my IDE is visual studio 2008 sp1
tnx -
wrote on 7 Dec 2011, 17:28 last edited by
You also need to download Qt Visual Studio Add-in.
-
wrote on 7 Dec 2011, 17:39 last edited by
"Here":/doc/gettingstarted.html is a good starting point.
-
wrote on 7 Dec 2011, 18:15 last edited by
yes tnx i download Qt Visual Studio Add-in but i cant Compile my code :( i create one Qt Application with Qt Add-in but take Error on compile time :( please help me i cant use Qt . please help me with Qt VS Add-in
-
wrote on 7 Dec 2011, 18:31 last edited by
my question exactly is "how to include qt headers and library to vs 2008"? if i install "qt-win-opensource-4.7.4-vs2008" and "Qt Visual Studio Add-in", its enough ?!! or i must compile or copy or set inlcude directory to vs ? sorry for my bad eng language
-
wrote on 7 Dec 2011, 18:57 last edited by
You need to set Qt installation directory. You should have Qt menu on VC menubar. Open it and choose Options and set Qt installation directory. Other solutions is to set QTDIR environment variable.
-
wrote on 7 Dec 2011, 19:01 last edited by
OK i open qt > qtoption . i have two tap one Qt versions that Add 4.7.4 c:\qt\4.7.4 and other tap is Qt Defualt setting :-?? what i must to do ?
-
wrote on 7 Dec 2011, 19:03 last edited by
c:\qt\4.7.4
-
wrote on 7 Dec 2011, 19:19 last edited by
yes this address is added to Qt Option > qt version
-
wrote on 7 Dec 2011, 19:22 last edited by
... and you still are unable to build projects with Qt dependency ?
If not, what are the errors ? -
wrote on 7 Dec 2011, 19:26 last edited by
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 -
wrote on 7 Dec 2011, 19:33 last edited by
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.
-
wrote on 7 Dec 2011, 19:35 last edited by
this is a preCode and i dont type this. its come when i use Add-in
-
wrote on 7 Dec 2011, 19:44 last edited by
So, it's not a include Qt headers error, this means VC recognize your Qt installation. I suspect something wrong in your code. Can you post the code ?
-
wrote on 7 Dec 2011, 20:38 last edited by
@
#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();
}
@ -
wrote on 7 Dec 2011, 20:39 last edited by
some body please help me :(((((((((
-
wrote on 7 Dec 2011, 23:50 last edited by
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.
-
wrote on 8 Dec 2011, 09:26 last edited by
sorry :( my IDE is visual stduio 2008 pro sp1. can i compile with this ?
i try to set Environment variable and download "qt-everywhere-opensource-src-4.7.4" then configure and run nmake but return error code 02 -
wrote on 8 Dec 2011, 10:55 last edited by
Yes, this works.
You can use the prebuilt binaries for VS2008 - there's no need to build them yourself. -
wrote on 8 Dec 2011, 11:40 last edited by
ok where can i download it . please send to me this link i try to find binaries for vs2008 sp1 but can not find it. i really really tnx if you send all necessary link that i must download them.
11/25