I have a huge list of these 'undefined reference to vtable' linker errors which I assume are all being caused by improper constructor/destructor definition, all referring to different classes called by the same cpp file.
You need to define the destructor so you need the curly braces somewhere. If you leave them out in the class definition you would have to define the destructor elsewhere.
> I assume are all being caused by improper constructor/destructor definition
They are caused by leaving out the definition of a non-pure virtual member function.
> Should I close with a deconstructor via:
> ~ConstructParticle(){}
¿do you have a `ConstructParticle' class?
in your code `ConstructParticle()' is a member function of `myPhysListHadron'
I think the problem is in the virtual constructor on line 18
1) Does the G4VPhysicsConstructor have any pure virtual functions?
If so, you must overload those functions and provide an implementation for them. Not doing so can cause vtable errors.
2) Do you have other classes deriving from myPhysListHadron? The implication would be that you do, since you've declared ConstructParticle() as virtual. Do you have an implementation (even if a dummy) for ConstructParticle() in your myPhysListHadron class? Not doing so can cause vtable errors.
Looking at your original error message:
undefined reference to `vtable for G4LEKaonZeroInelastic'
and your code for that constructor in your OP:
3) Does G4LEKaonZeroInelastic have any pure virtual functions you haven't implemented? Not implementing a base class's pure virtual functions in your derived class will cause vtable errors.
Not implementing Having a pure virtual member function would make the class abstract
You would get an cannot declare variable ‘foo’ to be of abstract type ‘T’ error.
I am checking my classes for undefined virtual functions, I assume this will resolve the issue and will mark this thread as resolved, to be reopened if necessary.