undefined reference to `vtable for
-
In this case, often you need to make clean and rebuild your project.
in cmake: remove build fold completely. rebuild everything
in qmake: make distclean. then rebuild. -
@SPlatten
To be clear: you mean that the file you have been showing us is theconfig.Hfile of the error message? And the implementation file isconfig.cppwhich is compiled toconfig.o. And the line #47staledata_t() : QObject(nullptr)is the one just under the
public:you show earlier? -
@SPlatten
To be clear: you mean that the file you have been showing us is theconfig.Hfile of the error message? And the implementation file isconfig.cppwhich is compiled toconfig.o. And the line #47staledata_t() : QObject(nullptr)is the one just under the
public:you show earlier? -
@SPlatten your class compiles perfectly fine for me, at least as long as I add the implementation of m_nextUDN, where exactly do you do that ?
I know you said/showed, you do it, but where exactly?
-
@SPlatten
Yeah, but is that "global scope", i.e. not inside anything else?@J-Hilk
The trouble is, withoutm_nextUDNdefined properly, I do not getundefined reference to vtable for asv::scm::helm::staledata_t'message, I get complaint about
m_nextUDNnot being defined.... -
@SPlatten
Yeah, but is that "global scope", i.e. not inside anything else?@J-Hilk
The trouble is, withoutm_nextUDNdefined properly, I do not getundefined reference to vtable for asv::scm::helm::staledata_t'message, I get complaint about
m_nextUDNnot being defined.... -
-
@J-Hilk said in undefined reference to `vtable for:
@SPlatten are you sure config.c is party of your project ? :D so the linker can find it
?? Look at actual linker statement being executed?
Hmm, originally you showed
.build/config.o: In function asv::scm::helm::staledata_t::staledata_t()':immediately above the
undefined reference to vtablemessage. Is that still present? Because that does imply the linker is trying to pull inconfig.o, which would imply it does appear on the linker command line.... Is that indeed the right.build/config.opath for theconfig.oyou keep rebuilding? -
soooo, since you'e not using m_nextUDN anywhere else and its private.... have you considered simply using:
static uint16_t nextUDN() { static uint16_t m_nextUDN = 0; return ++(m_nextUDN); }?