Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Hello everyone, I can not inherit one class of cpp file into another class of cpp file. i get error like undefined base class etc.
Do you have separate *.h and *.cpp file ? Did you include the base class header file ? Are you including A class in B and B class in A ? Just check
Yes i have separate .cpp and .h file and also include header file of one cpp file into another header file of cpp file. Still i get error "Base class undefined".
The please show your code. It's impossible to tell what is going wrong without any code.
Code is.. Base class is Point3d and child class is Vector3d.
class Vector3d:public Point3d
Vector3d(float xp, float yp, float zp);
Error is:C2504: 'Point3d' : base class undefined
I'm facing the same error like :
error: C2504: 'Point3d' : base class undefined
and if you look in
what is the class name there ?
@NgtLvr You have cyclic dependencies between your header files: vector3d.h includes point3d.h and point3d.h includes vector3d.h. First question is: why does your Point3d need to know anything about Vector3d?
oops!!! Sorry, You are right, there is a cyclic dependencies between two classes...
Thanks for your quick response...
Cool. A->B and B->A Cyclic case. This is what I said my first response. Enjoy. Move the issue to "Solved" state.
Yeah that's the problem as you say cause of there are huge numbers of cpp file in hierarchy so that's the matter.