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] undefined reference to 'vtable for ...'
Qt 6.11 is out! See what's new in the release blog

[solved] undefined reference to 'vtable for ...'

Scheduled Pinned Locked Moved General and Desktop
14 Posts 6 Posters 15.5k Views 2 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.
  • R Offline
    R Offline
    Rahul Das
    wrote on last edited by
    #4

    The above code is running perfectly for me. Couldn't reproduce the issue.

    bq. I tried without instanciate Q_OBJECT in the .h file

    You need Q_OBJECT macro, so that MOC (meta Object Compiler) will do the necessary to implement signals and slots . Refer "Meta-Object system":http://doc.qt.nokia.com/4.7/metaobjects.html#meta-object-system

    Late relpy : i meant the first post.


    Declaration of (Platform) independence.

    1 Reply Last reply
    0
    • ? Offline
      ? Offline
      A Former User
      wrote on last edited by
      #5

      Try rebuilding your project (just remove the build directory). It is a moc issue

      1 Reply Last reply
      0
      • ? Offline
        ? Offline
        A Former User
        wrote on last edited by
        #6

        Such problems are usually solved by (manually) re-running qmake.

        1 Reply Last reply
        0
        • ? Offline
          ? Offline
          A Former User
          wrote on last edited by
          #7

          Oh great, you're right, I deleted the build folder and that's work pretty good !! I don't really know why it doesn't work at the first time, the MOC is the pre-compiled processor instructions ?

          1 Reply Last reply
          0
          • ? Offline
            ? Offline
            A Former User
            wrote on last edited by
            #8

            No, moc is the "Meta-Object Compiler":http://doc.qt.nokia.com/latest/moc.html.

            1 Reply Last reply
            0
            • ? Offline
              ? Offline
              A Former User
              wrote on last edited by
              #9

              Ok thanks, I just have two more questions ...

              1. Do you know how can I get some values of a QComboBox (I tried with currentIndex() function and currentText but it doesn't really works...)

              2. Which project can let me generate an application but without Qt development tool (like .exe and can be ran without problems...)

              Anyway, I appreciate your help

              PS: I'm a beginner with Qt ...

              1 Reply Last reply
              0
              • ? Offline
                ? Offline
                A Former User
                wrote on last edited by
                #10
                • currentIndex() and currentText() is the way to go. If they return invalid data there is most probably no item selected or the combo box is empty.
                • Every single Application type (Qt Quick Application, Qt Gui Application, Mobile Qt Application, ...) generates a standalone binary (.exe). But you will have to distribute - as with every other non-Qt application - the "runtime dependencies":http://doc.qt.nokia.com/latest/deployment-windows.html along with your application.
                1 Reply Last reply
                0
                • R Offline
                  R Offline
                  Rahul Das
                  wrote on last edited by
                  #11

                  In addition you can try compiling statically. so that every libraries and dependencies packed into a single executable.

                  "Ref":http://doc.qt.nokia.com/stable/deployment.html


                  Declaration of (Platform) independence.

                  1 Reply Last reply
                  0
                  • ? Offline
                    ? Offline
                    A Former User
                    wrote on last edited by
                    #12

                    Thanks a lot guys! You're getting me out of every problems and I appreciate it !!

                    1 Reply Last reply
                    0
                    • R Offline
                      R Offline
                      Rahul Das
                      wrote on last edited by
                      #13

                      You're welcome :) Happy coding :)


                      Declaration of (Platform) independence.

                      1 Reply Last reply
                      0
                      • A Offline
                        A Offline
                        andr1312e
                        wrote on last edited by
                        #14

                        It may happen if you change file path and header and cpp files has different paths

                        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