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. Q_OBJECT macro not working

Q_OBJECT macro not working

Scheduled Pinned Locked Moved Unsolved General and Desktop
qobjectvscodecmake
4 Posts 3 Posters 490 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.
  • U Offline
    U Offline
    ugo_
    wrote on last edited by
    #1

    I am using cmake and vscode, i can't get MOC to work, details in this SO link: https://stackoverflow.com/questions/75544361/q-object-label-not-working-undefined-reference-to-vtable

    JonBJ 1 Reply Last reply
    0
    • U ugo_

      I am using cmake and vscode, i can't get MOC to work, details in this SO link: https://stackoverflow.com/questions/75544361/q-object-label-not-working-undefined-reference-to-vtable

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #2

      @ugo_
      Did you delete out all the files in the build output directory, and re-run cmake followed by building the project for the first time?

      U 1 Reply Last reply
      0
      • JonBJ JonB

        @ugo_
        Did you delete out all the files in the build output directory, and re-run cmake followed by building the project for the first time?

        U Offline
        U Offline
        ugo_
        wrote on last edited by
        #3

        @JonB I solved the issue by including the header in the add_executable command, which by the way I consider a very ugly way to do it, do you know any other way?

        J.HilkJ 1 Reply Last reply
        0
        • U ugo_

          @JonB I solved the issue by including the header in the add_executable command, which by the way I consider a very ugly way to do it, do you know any other way?

          J.HilkJ Offline
          J.HilkJ Offline
          J.Hilk
          Moderators
          wrote on last edited by J.Hilk
          #4

          @ugo_ I'm failing to see CMAKE_AUTOMOC in your cmake file, did you forget to enable moc for your project?

          Nope, I'm just blind :D


          Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


          Q: What's that?
          A: It's blue light.
          Q: What does it do?
          A: It turns blue.

          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