Debugging vtable Linker Errors in GCC -
Now when I'm using GCC I get secret errors like this:
'vtable Undefined reference classname for '
When this is not caused by a missing library, this very descriptive error message will always let me find the missing implementation for the virtual function line from the line of code files Due to digging through the medium. Does anybody linking tell me which is missing the virtual function, perhaps a flag or something else? Or is it perhaps telling me, but I do not know what it is saying?
from:
When creating C ++ , The linker essentially defines my constructor, destructors, or virtual tables, but I have defined them
The ISO C ++ standard does not have all virtual pure virtual The methods of a class should be defined, but any rule required for violation of this rule [class.virtual] / 8 On the basis of this assumption, the GCC only leaves the underlying defined constructor, assignment operator, district and virtual table in a translation unit, which defines its first such non-inline method.
Therefore, if you fail to define this particular method, then the linker can clearly complain about the lack of definitions for unrelated symbols. Unfortunately, to correct this error message, it may be necessary to change the linker, and it can not always be done.
The solution is to ensure that all the virtual methods which are not pure are defined. Note that a destructor should be defined, even if it is pure-virtual [class. TOR] / 7 has been declared.
The solution I choose is searching for a classname and there is no definition for the virtual methods announcement and inquiry if I have no other solution.
Comments
Post a Comment