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. I get unresolved external symbols concerning Q_OBJECT
QtWS25 Last Chance

I get unresolved external symbols concerning Q_OBJECT

Scheduled Pinned Locked Moved Solved General and Desktop
linker errors
7 Posts 4 Posters 551 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.
  • J Offline
    J Offline
    jdent
    wrote on 7 Oct 2024, 22:04 last edited by jdent 10 Jul 2024, 22:05
    #1
    unresolved external symbol "public: virtual struct QMetaObject const * __cdecl VectorModel::metaObject(void)const " (?metaObject@VectorModel@@UEBAPEBUQMetaObject@@XZ::<!VectorModel>)
    
     unresolved external symbol "public: virtual void * __cdecl VectorModel::qt_metacast(char const *)" (?qt_metacast@VectorModel@@UEAAPEAXPEBD@Z::<!VectorModel>)
    
    unresolved external symbol "public: virtual int __cdecl VectorModel::qt_metacall(enum QMetaObject::Call,int,void * *)" (?qt_metacall@VectorModel@@UEAAHW4Call@QMetaObject@@HPEAPEAX@Z::<!VectorModel>)
    

    I am using C++ 20 modules....

    R 1 Reply Last reply 8 Oct 2024, 05:40
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 8 Oct 2024, 19:06 last edited by
      #6

      Hi,

      AFAIR (and this ticket seems to agree with my memory), the module support is not yet implemented in moc.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • J Offline
        J Offline
        jdent
        wrote on 7 Oct 2024, 22:29 last edited by
        #2

        when I remove VectorModel from a C++ 20 module, I get the opposite linker warnings (multiply defined symbols found) - why??

        1>moc_VectorModel.obj : error LNK2005: "public: static struct QMetaObject const VectorModel::staticMetaObject" (?staticMetaObject@VectorModel@@2UQMetaObject@@B) already defined in moc_VectorModelImpl.obj
        
        
        1>moc_VectorModel.obj : error LNK2005: "private: static void __cdecl VectorModel::qt_static_metacall(class QObject *,enum QMetaObject::Call,int,void * *)" (?qt_static_metacall@VectorModel@@CAXPEAVQObject@@W4Call@QMetaObject@@HPEAPEAX@Z) already defined in moc_VectorModelImpl.obj
        
        

        and others...

        1 Reply Last reply
        0
        • A Offline
          A Offline
          ankou29666
          wrote on 8 Oct 2024, 00:04 last edited by
          #3
          This post is deleted!
          1 Reply Last reply
          0
          • J jdent
            7 Oct 2024, 22:04
            unresolved external symbol "public: virtual struct QMetaObject const * __cdecl VectorModel::metaObject(void)const " (?metaObject@VectorModel@@UEBAPEBUQMetaObject@@XZ::<!VectorModel>)
            
             unresolved external symbol "public: virtual void * __cdecl VectorModel::qt_metacast(char const *)" (?qt_metacast@VectorModel@@UEAAPEAXPEBD@Z::<!VectorModel>)
            
            unresolved external symbol "public: virtual int __cdecl VectorModel::qt_metacall(enum QMetaObject::Call,int,void * *)" (?qt_metacall@VectorModel@@UEAAHW4Call@QMetaObject@@HPEAPEAX@Z::<!VectorModel>)
            

            I am using C++ 20 modules....

            R Offline
            R Offline
            Redman
            wrote on 8 Oct 2024, 05:40 last edited by
            #4

            @jdent

            Did you include the moc file in your cpp?

            1 Reply Last reply
            0
            • J Offline
              J Offline
              jdent
              wrote on 8 Oct 2024, 16:49 last edited by
              #5

              How do I know that?

              1 Reply Last reply
              0
              • S Offline
                S Offline
                SGaist
                Lifetime Qt Champion
                wrote on 8 Oct 2024, 19:06 last edited by
                #6

                Hi,

                AFAIR (and this ticket seems to agree with my memory), the module support is not yet implemented in moc.

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                1 Reply Last reply
                0
                • J Offline
                  J Offline
                  jdent
                  wrote on 8 Oct 2024, 20:02 last edited by
                  #7

                  thanks!!

                  1 Reply Last reply
                  0
                  • J jdent has marked this topic as solved on 8 Oct 2024, 20:02

                  1/7

                  7 Oct 2024, 22:04

                  • Login

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