Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Please Help me How to install QT on VC++ 2008

Please Help me How to install QT on VC++ 2008

Scheduled Pinned Locked Moved Installation and Deployment
25 Posts 4 Posters 10.0k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    ahura_24
    wrote on 7 Dec 2011, 16:37 last edited by
    #2

    my windows is windows 7 64 bit and my IDE is visual studio 2008 sp1
    tnx

    1 Reply Last reply
    0
    • V Offline
      V Offline
      VanDerSam
      wrote on 7 Dec 2011, 17:28 last edited by
      #3

      You also need to download Qt Visual Studio Add-in.

      1 Reply Last reply
      0
      • G Offline
        G Offline
        goetz
        wrote on 7 Dec 2011, 17:39 last edited by
        #4

        "Here":/doc/gettingstarted.html is a good starting point.

        http://www.catb.org/~esr/faqs/smart-questions.html

        1 Reply Last reply
        0
        • A Offline
          A Offline
          ahura_24
          wrote on 7 Dec 2011, 18:15 last edited by
          #5

          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

          1 Reply Last reply
          0
          • A Offline
            A Offline
            ahura_24
            wrote on 7 Dec 2011, 18:31 last edited by
            #6

            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

            1 Reply Last reply
            0
            • C Offline
              C Offline
              cincirin
              wrote on 7 Dec 2011, 18:57 last edited by
              #7

              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.

              1 Reply Last reply
              0
              • A Offline
                A Offline
                ahura_24
                wrote on 7 Dec 2011, 19:01 last edited by
                #8

                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 ?

                1 Reply Last reply
                0
                • C Offline
                  C Offline
                  cincirin
                  wrote on 7 Dec 2011, 19:03 last edited by
                  #9

                  c:\qt\4.7.4

                  1 Reply Last reply
                  0
                  • A Offline
                    A Offline
                    ahura_24
                    wrote on 7 Dec 2011, 19:19 last edited by
                    #10

                    yes this address is added to Qt Option > qt version

                    1 Reply Last reply
                    0
                    • C Offline
                      C Offline
                      cincirin
                      wrote on 7 Dec 2011, 19:22 last edited by
                      #11

                      ... and you still are unable to build projects with Qt dependency ?
                      If not, what are the errors ?

                      1 Reply Last reply
                      0
                      • A Offline
                        A Offline
                        ahura_24
                        wrote on 7 Dec 2011, 19:26 last edited by
                        #12

                        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

                        1 Reply Last reply
                        0
                        • C Offline
                          C Offline
                          cincirin
                          wrote on 7 Dec 2011, 19:33 last edited by
                          #13

                          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.

                          1 Reply Last reply
                          0
                          • A Offline
                            A Offline
                            ahura_24
                            wrote on 7 Dec 2011, 19:35 last edited by
                            #14

                            this is a preCode and i dont type this. its come when i use Add-in

                            1 Reply Last reply
                            0
                            • C Offline
                              C Offline
                              cincirin
                              wrote on 7 Dec 2011, 19:44 last edited by
                              #15

                              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 ?

                              1 Reply Last reply
                              0
                              • A Offline
                                A Offline
                                ahura_24
                                wrote on 7 Dec 2011, 20:38 last edited by
                                #16

                                @
                                #ifndef QT_H
                                #define QT_H

                                #include <QtGui/QMainWindow>
                                #include "ui_qt.h"

                                class Qt : public QMainWindow
                                {
                                Q_OBJECT

                                public:
                                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();
                                }
                                @

                                1 Reply Last reply
                                0
                                • A Offline
                                  A Offline
                                  ahura_24
                                  wrote on 7 Dec 2011, 20:39 last edited by
                                  #17

                                  some body please help me :(((((((((

                                  1 Reply Last reply
                                  0
                                  • G Offline
                                    G Offline
                                    goetz
                                    wrote on 7 Dec 2011, 23:50 last edited by
                                    #18

                                    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.

                                    http://www.catb.org/~esr/faqs/smart-questions.html

                                    1 Reply Last reply
                                    0
                                    • A Offline
                                      A Offline
                                      ahura_24
                                      wrote on 8 Dec 2011, 09:26 last edited by
                                      #19

                                      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

                                      1 Reply Last reply
                                      0
                                      • G Offline
                                        G Offline
                                        goetz
                                        wrote on 8 Dec 2011, 10:55 last edited by
                                        #20

                                        Yes, this works.
                                        You can use the prebuilt binaries for VS2008 - there's no need to build them yourself.

                                        http://www.catb.org/~esr/faqs/smart-questions.html

                                        1 Reply Last reply
                                        0
                                        • A Offline
                                          A Offline
                                          ahura_24
                                          wrote on 8 Dec 2011, 11:40 last edited by
                                          #21

                                          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.

                                          1 Reply Last reply
                                          0

                                          11/25

                                          7 Dec 2011, 19:22

                                          • Login

                                          • Login or register to search.
                                          11 out of 25
                                          • First post
                                            11/25
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • Users
                                          • Groups
                                          • Search
                                          • Get Qt Extensions
                                          • Unsolved