Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [SOLVED]Microsoft Visual Studio 2010 compiler
Forum Updated to NodeBB v4.3 + New Features

[SOLVED]Microsoft Visual Studio 2010 compiler

Scheduled Pinned Locked Moved General and Desktop
12 Posts 3 Posters 9.6k Views 1 Watching
  • 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.
  • S Offline
    S Offline
    shahid.pk
    wrote on last edited by
    #2

    There could be too reasons for the above error

    1. moc is not executed for the mainwindow class to generate c++ code for the compiler.

    2.If moc is executed which qmake do by default then implementation of mainwindow and the declaration of mainwindow will be in the same file

    make sure you are not doing the above two things...

    Love to learn....

    1 Reply Last reply
    0
    • M Offline
      M Offline
      Mr.FreakyJo
      wrote on last edited by
      #3

      the declaration is in mainwindow.h and the implementantion is in mainwindow.cpp and moc_mainwindow.cpp .

      @if !defined(Q_MOC_OUTPUT_REVISION)
      #error "The header file 'mainwindow.h' doesn't include <QObject>."
      #elif Q_MOC_OUTPUT_REVISION != 63
      #error "This file was generated using the moc from 4.8.0. It"
      #error "cannot be used with the include files from this version of Qt."
      #error "(The moc has changed too much.)"@

      This is the file generated by moc

      1 Reply Last reply
      0
      • ? This user is from outside of this forum
        ? This user is from outside of this forum
        Guest
        wrote on last edited by
        #4

        MOC shouldn't have problems as long as you followed best practices and declared everything in separate headers with all files included in the project file.

        What exactly are you trying to achieve by inheriting Ui::MainWindow?

        1 Reply Last reply
        0
        • G Offline
          G Offline
          goetz
          wrote on last edited by
          #5

          Method planNewAtack() is not implemented.

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

          1 Reply Last reply
          0
          • ? This user is from outside of this forum
            ? This user is from outside of this forum
            Guest
            wrote on last edited by
            #6

            Ah yes, I recently stumbled upon this issue in Creator/GCC as well, this is NOT MSVC compiler specific at all. Even an empty temporary implementation did the trick

            1 Reply Last reply
            0
            • M Offline
              M Offline
              Mr.FreakyJo
              wrote on last edited by
              #7

              Thanks Volker.I forgot that I create the dialog in main constructor and forgot to delete that slot.

              1 Reply Last reply
              0
              • M Offline
                M Offline
                Mr.FreakyJo
                wrote on last edited by
                #8

                Now i have another error,hope you read this.Why I receive the error 'class' type redefinition?I changed the class name and I still receive this error.The header of the class is something like this:
                @#ifndef DIALOGPLANNEWATACK_H
                #define DIALOGPLANNEWATAC_H
                #include <QDialog>
                #include "ui_dialogPlanNewAtack.h"
                class dialogPlanAtacktest :public QDialog,Ui::dialogPlanNewAtack
                {
                int i;
                public:
                dialogPlanAtacktest();
                };
                #endif@

                1 Reply Last reply
                0
                • G Offline
                  G Offline
                  goetz
                  wrote on last edited by
                  #9

                  It's impossible to say what's going wrong without seing the rest of the code.

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

                  1 Reply Last reply
                  0
                  • M Offline
                    M Offline
                    Mr.FreakyJo
                    wrote on last edited by
                    #10

                    i missed a letter in de header guard :)

                    1 Reply Last reply
                    0
                    • ? This user is from outside of this forum
                      ? This user is from outside of this forum
                      Guest
                      wrote on last edited by
                      #11

                      Why don't you just let Creator do the header guards for you? Instead of creating a header and cpp file just create a new class and you got it all.

                      You can also use Creator to automatically create method implementations and even sync changes in them. Besides saving time this is a great way to avoid nasty little typos.

                      You can still use the MSVC compiler from Creator, it will be detected and you will be offered MSVC build configurations.

                      1 Reply Last reply
                      0
                      • M Offline
                        M Offline
                        Mr.FreakyJo
                        wrote on last edited by
                        #12

                        I'm not used with Creator...I'll try the Creator when I will have a deeper undestanding in QT and more experience in it.I learnt C++ and Qt on my own and still got a lot to learn.

                        1 Reply Last reply
                        0

                        • Login

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