can't find linker symbol for virtual table for `MainWindow' value
-
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. -
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.@Driftwood said in can't find linker symbol for virtual table for `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)? -
@Driftwood said in can't find linker symbol for virtual table for `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)?@jsulm said in can't find linker symbol for virtual table for `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:
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?
-
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.
@mchinand said in can't find linker symbol for virtual table for `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 aBibleKnowledge
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