why i am facing this error ?

why i am facing this error in my code ? again and again ! how can i get rid of this?

Error1 error LNK2019: unresolved external symbol "public: __thiscall C::C(void)" (??0C@@QAE@XZ) referenced in function _main C:\Users\corleone\Documents\Visual Studio 2010\Projects\Practice\Practice\p1.obj Practice

Error2 error LNK1120: 1 unresolved externals C:\Users\corleone\Documents\Visual Studio 2010\Projects\Practice\Debug\Practice.exe Practice

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include<iostream>
using namespace std;

class A
{
private :
	int a1;
public:
	A();
	void g()
	{cout<<"A"<<endl;}
};
class B
{
private:
	int b1;
public:
	B();
	void g()
	{cout<<"B"<<endl;}
};
class C:public B
{
private:
	int c1;
public:
	C();
	void g()
	{cout<<"C"<<endl;}
};



int main()
{
	C c;
	B * p = &c; 
	p->g();
	
	return 0;
}
Last edited on
You have not defined the constructors...
Topic archived. No new replies allowed.