Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Including moc files resulting a symbol not defined
Forum Updated to NodeBB v4.3 + New Features

Including moc files resulting a symbol not defined

Scheduled Pinned Locked Moved Mobile and Embedded
4 Posts 3 Posters 2.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.
  • L Offline
    L Offline
    Luc4
    wrote on last edited by
    #1

    Hi! I'm writing a plugin for Qt, starting from an already existing plugin in Qt. I'm experiencing something strange: at the end of a source file there is an inclusion of a .moc file, which is located somewhere in the Qt tree. If I remove that inclusion I get that a symbol is not defined in the library (I get an error runtime and that symbol is not in the shared lib indeed).

    Anyone can explain why that is happening and how I can avoid it? The plugin I'm talking about is the LinuxTP mouse driver.
    Thank!

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andre
      wrote on last edited by
      #2

      Including the moc file is needed if you don't use qmake, I think. What build system do you use?

      1 Reply Last reply
      0
      • D Offline
        D Offline
        dangelog
        wrote on last edited by
        #3

        [quote author="Luc4" date="1305205052"]Hi! I'm writing a plugin for Qt, starting from an already existing plugin in Qt. I'm experiencing something strange: at the end of a source file there is an inclusion of a .moc file, which is located somewhere in the Qt tree. If I remove that inclusion I get that a symbol is not defined in the library (I get an error runtime and that symbol is not in the shared lib indeed).

        Anyone can explain why that is happening and how I can avoid it? The plugin I'm talking about is the LinuxTP mouse driver.
        Thank![/quote]

        It's a standard trick to fool qmake when you use Q_OBJECT classes in a .cpp file.

        Software Engineer
        KDAB (UK) Ltd., a KDAB Group company

        1 Reply Last reply
        0
        • L Offline
          L Offline
          Luc4
          wrote on last edited by
          #4

          In fact I just guessed that. I solved by creating the header file.
          Thanks!

          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