> 
> **Possible Duplicate:**  
> 
> [How to resolve “LINK : fatal error LNK1561: entry point must be defined”?](https://stackoverflow.com/questions/1169822/how-to-resolve-link-fatal-error-lnk1561-entry-point-must-be-defined) 
> 
> 
> 

I have class A and B like this and upon linking there is error: error LNK1561: entry point must be defined. What am I doing wrong?

```
#include <string>
#include <cstdlib>

class A 
{
public:
A(){}
~A(){}
string getName()
{ return name; }
void setName(string name)
{this->name = name;}
void write()
{
   cout << "Value:" << getName() << endl;
}
protected:
string name;
};

#include <string>
#include "A.h"
class B : public A
{
public:
B()
{
setName("B");
}
~B(){}
};

#include "A.h"
#include "B.h"
#include <cstdlib>

int main()
{
B abc = B();
abc.write();

system("PAUSE");
return 0;
 }

```

I get following errors:

error C2039: 'name' : is not a member of 'A'  

error C2061: syntax error : identifier 'string'  

error C2065: 'cout' : undeclared identifier  

error C2065: 'endl' : undeclared identifier  

error C2065: 'name' : undeclared identifier  

error C2146: syntax error : missing ';' before identifier 'getName'  

error C2146: syntax error : missing ';' before identifier 'name'  

error C2660: 'A::setName' : function does not take 1 arguments  

error C4430: missing type specifier - int assumed. Note: C++ does not support default-int