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. can't find linker symbol for virtual table for `MainWindow' value
Forum Updated to NodeBB v4.3 + New Features

can't find linker symbol for virtual table for `MainWindow' value

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 3 Posters 1.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.
  • DriftwoodD Offline
    DriftwoodD Offline
    Driftwood
    wrote on last edited by Driftwood
    #1

    In creating a Desktop application, I use Qt Creator to create the app and to build the GUI, then code it up using CLion's editor. It's usually a nice world. However, today, when I ran the app from inside Qt Creator, I got an error and my app crashed on startup. But when I ran it from inside CLion, I got no errors.

    The error from Creator is:

    can't find linker symbol for virtual table for `MainWindow' value
      found `QtPrivate::QMetaTypeInterfaceWrapper<int>::metaType' instead
    

    I realize that a linker symbol is "missing". But how do I fix it so that Creator stops complaining?

    UPDATE:
    In searching for a resolution to this issue, I'm beginning to believe this is a debugger (gdb) problem. Uncertain though.

    jsulmJ 1 Reply Last reply
    0
    • DriftwoodD Driftwood

      In creating a Desktop application, I use Qt Creator to create the app and to build the GUI, then code it up using CLion's editor. It's usually a nice world. However, today, when I ran the app from inside Qt Creator, I got an error and my app crashed on startup. But when I ran it from inside CLion, I got no errors.

      The error from Creator is:

      can't find linker symbol for virtual table for `MainWindow' value
        found `QtPrivate::QMetaTypeInterfaceWrapper<int>::metaType' instead
      

      I realize that a linker symbol is "missing". But how do I fix it so that Creator stops complaining?

      UPDATE:
      In searching for a resolution to this issue, I'm beginning to believe this is a debugger (gdb) problem. Uncertain though.

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

      @Driftwood said in can't find linker symbol for virtual table for &#x60;MainWindow' value:

      I'm beginning to believe this is a debugger (gdb) problem

      No, it is an issue while linking.
      Did you try to do a complete rebuild in QtCreator (delete build folder, run qmake, build)?

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

      DriftwoodD 1 Reply Last reply
      0
      • jsulmJ jsulm

        @Driftwood said in can't find linker symbol for virtual table for &#x60;MainWindow' value:

        I'm beginning to believe this is a debugger (gdb) problem

        No, it is an issue while linking.
        Did you try to do a complete rebuild in QtCreator (delete build folder, run qmake, build)?

        DriftwoodD Offline
        DriftwoodD Offline
        Driftwood
        wrote on last edited by
        #3

        @jsulm said in can't find linker symbol for virtual table for &#x60;MainWindow' value:

        Did you try to do a complete rebuild in QtCreator (delete build folder, run qmake, build)?

        In Creator, I load my project from the project directory. And what I discovered is that Qt, for some unknown reason, is using a build of close-to-the-same from another directory. I have two of these same apps in two different folders.

        This is how it rolls out for me:

        Qt-001.png

        Qt-002.png

        Note that Qt Creator uses a build from /CppStuff/ when I run the app, not from the folder that I opened it from (as seen in the first image).

        I don't know how this happens; CLion runs this properly. Is there a way to fix this, to make Creator use the correct build directory?

        1 Reply Last reply
        0
        • M Offline
          M Offline
          mchinand
          wrote on last edited by
          #4

          What you're seeing is the project/source folder in your first screenshot and your build folder in your second screenshot. It is normal and preferred that they are different so that your source folder is kept clean from generated files.

          DriftwoodD 1 Reply Last reply
          0
          • M mchinand

            What you're seeing is the project/source folder in your first screenshot and your build folder in your second screenshot. It is normal and preferred that they are different so that your source folder is kept clean from generated files.

            DriftwoodD Offline
            DriftwoodD Offline
            Driftwood
            wrote on last edited by
            #5

            @mchinand said in can't find linker symbol for virtual table for &#x60;MainWindow' value:

            What you're seeing is the project/source folder in your first screenshot and your build folder in your second screenshot. It is normal and preferred that they are different so that your source folder is kept clean from generated files.

            I'm not so sure about that.

            The project folder is /Desktop/CLion_Qt/BibleKnowledge.

            But Creator, after loading the project, uses /Desktop/CppStuff/CLion_Qt/BibleKnowledge. While there is a BibleKnowledge project in this location, it isn't the project I'm loading. I no longer use this particular project.

            What I don't understand is why Creator is using a build folder from a project I'm not loading. The project I'm loading is from /Desktop/CLion_Qt/BibleKnowledge, not /Desktop/CppStuff/CLion_Qt/BibleKnowledge.

            When I open the /Desktop/CLion_Qt/BibleKnowledge project in CLion, CLion uses that folder to create the builds, as well it should. But for some reason, Creator wants to use /Desktop/CppStuff/CLion_Qt/BibleKnowledge to build from a project opened in /Desktop/CLion_Qt/BibleKnowledge

            1 Reply Last reply
            0
            • M Offline
              M Offline
              mchinand
              wrote on last edited by
              #6

              You can also start fresh and reconfigure your project. With QtCreator closed; delete the build folder(s) and the CMakeLists.txt.user file in your project folder. Then open the project again in QtCreator.

              1 Reply Last reply
              1

              • Login

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