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. Turning off Shadow build leads to a bunch of weird linker errors
Forum Updated to NodeBB v4.3 + New Features

Turning off Shadow build leads to a bunch of weird linker errors

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 2 Posters 548 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.
  • I Offline
    I Offline
    In Fo
    wrote on last edited by In Fo
    #1

    I do not want to use shadow build my own reasons, but I just discovered that my project links successfully only when shadow build is turned on. If I turn it off, I get 5 linker errors regarding 1(!) single class which lives in the same .h file with another class that does not produce linker errors.
    What is wrong here?

    Assuming that I can live with shadow build for the time being, I still need to be able to run the output .exe standalone (outside of QT Creator). I copy all of the QT5 .dlls that the debug and release .exes require, but they still do not start. They throw "This application was unable to start correctly (0xc00000007b)" errors.
    What is wrong here?

    jsulmJ 1 Reply Last reply
    0
    • I In Fo

      I do not want to use shadow build my own reasons, but I just discovered that my project links successfully only when shadow build is turned on. If I turn it off, I get 5 linker errors regarding 1(!) single class which lives in the same .h file with another class that does not produce linker errors.
      What is wrong here?

      Assuming that I can live with shadow build for the time being, I still need to be able to run the output .exe standalone (outside of QT Creator). I copy all of the QT5 .dlls that the debug and release .exes require, but they still do not start. They throw "This application was unable to start correctly (0xc00000007b)" errors.
      What is wrong here?

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @In-Fo said in Turning off Shadow build leads to a bunch of weird linker errors:

      I still need to be able to run the output .exe standalone

      Check https://doc.qt.io/qt-5/deployment.html, there is more to it than copying Qt5 dlls (plug-ins for example).

      Also, you did not tell what the linker error actually is.

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      3
      • I Offline
        I Offline
        In Fo
        wrote on last edited by In Fo
        #3

        The linker errors refer to unresolved symbols that are methods of my class, like I said.

        newform.obj:-1: error: LNK2001: unresolved external symbol "public: virtual struct QMetaObject const * __cdecl fileHelperSignalHelper::metaObject(void)const " (?metaObject@fileHelperSignalHelper@@UEBAPEBUQMetaObject@@XZ)

        newform.obj:-1: error: LNK2001: unresolved external symbol "public: virtual void * __cdecl fileHelperSignalHelper::qt_metacast(char const *)" (?qt_metacast@fileHelperSignalHelper@@UEAAPEAXPEBD@Z)

        newform.obj:-1: error: LNK2001: unresolved external symbol "public: virtual int __cdecl fileHelperSignalHelper::qt_metacall(enum QMetaObject::Call,int,void * *)" (?qt_metacall@fileHelperSignalHelper@@UEAAHW4Call@QMetaObject@@HPEAPEAX@Z)

        newform.obj:-1: error: LNK2019: unresolved external symbol "public: void __cdecl fileHelperSignalHelper::saveProgressChanged(unsigned int)" (?saveProgressChanged@fileHelperSignalHelper@@QEAAXI@Z) referenced in function "private: void __cdecl newForm::handleBtnSaveCurrent(void)" (?handleBtnSaveCurrent@newForm@@AEAAXXZ)

        fileHelper.obj:-1: error: LNK2001: unresolved external symbol "public: void __cdecl fileHelperSignalHelper::saveProgressChanged(unsigned int)" (?saveProgressChanged@fileHelperSignalHelper@@QEAAXI@Z)

        newform.obj:-1: error: LNK2001: unresolved external symbol "public: static struct QMetaObject const fileHelperSignalHelper::staticMetaObject" (?staticMetaObject@fileHelperSignalHelper@@2UQMetaObject@@B)

        jsulmJ 1 Reply Last reply
        0
        • I In Fo

          The linker errors refer to unresolved symbols that are methods of my class, like I said.

          newform.obj:-1: error: LNK2001: unresolved external symbol "public: virtual struct QMetaObject const * __cdecl fileHelperSignalHelper::metaObject(void)const " (?metaObject@fileHelperSignalHelper@@UEBAPEBUQMetaObject@@XZ)

          newform.obj:-1: error: LNK2001: unresolved external symbol "public: virtual void * __cdecl fileHelperSignalHelper::qt_metacast(char const *)" (?qt_metacast@fileHelperSignalHelper@@UEAAPEAXPEBD@Z)

          newform.obj:-1: error: LNK2001: unresolved external symbol "public: virtual int __cdecl fileHelperSignalHelper::qt_metacall(enum QMetaObject::Call,int,void * *)" (?qt_metacall@fileHelperSignalHelper@@UEAAHW4Call@QMetaObject@@HPEAPEAX@Z)

          newform.obj:-1: error: LNK2019: unresolved external symbol "public: void __cdecl fileHelperSignalHelper::saveProgressChanged(unsigned int)" (?saveProgressChanged@fileHelperSignalHelper@@QEAAXI@Z) referenced in function "private: void __cdecl newForm::handleBtnSaveCurrent(void)" (?handleBtnSaveCurrent@newForm@@AEAAXXZ)

          fileHelper.obj:-1: error: LNK2001: unresolved external symbol "public: void __cdecl fileHelperSignalHelper::saveProgressChanged(unsigned int)" (?saveProgressChanged@fileHelperSignalHelper@@QEAAXI@Z)

          newform.obj:-1: error: LNK2001: unresolved external symbol "public: static struct QMetaObject const fileHelperSignalHelper::staticMetaObject" (?staticMetaObject@fileHelperSignalHelper@@2UQMetaObject@@B)

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @In-Fo Looks like you do not build/link auto-generated moc_*.cpp file

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          I 1 Reply Last reply
          1
          • I Offline
            I Offline
            In Fo
            wrote on last edited by
            #5

            What do you mean by "I do not"?

            1 Reply Last reply
            0
            • jsulmJ jsulm

              @In-Fo Looks like you do not build/link auto-generated moc_*.cpp file

              I Offline
              I Offline
              In Fo
              wrote on last edited by
              #6

              @jsulm said in Turning off Shadow build leads to a bunch of weird linker errors:

              @In-Fo Looks like you do not build/link auto-generated moc_*.cpp file

              Can you elaborate on "I do not build auto-generated file"? What manual actions outside of Qt Creator are required to have it build that auto-generated file?

              jsulmJ 1 Reply Last reply
              0
              • I In Fo

                @jsulm said in Turning off Shadow build leads to a bunch of weird linker errors:

                @In-Fo Looks like you do not build/link auto-generated moc_*.cpp file

                Can you elaborate on "I do not build auto-generated file"? What manual actions outside of Qt Creator are required to have it build that auto-generated file?

                jsulmJ Offline
                jsulmJ Offline
                jsulm
                Lifetime Qt Champion
                wrote on last edited by
                #7

                @In-Fo Take a look here: https://doc.qt.io/qt-5/why-moc.html
                Usually you do not have to care about it as QMake will do. It will add instructions to the makefiles to generate, build and link moc files. In your case it seems not to happen for what ever reason. You can post the whole build log.

                https://forum.qt.io/topic/113070/qt-code-of-conduct

                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