W
wenqiang.zhou
************************************************
#include <iostream>
#include <string>
using namespace std;
class Shape
{
public:
Shape(void) {}
~Shape(void) {}
virtual void draw(void) const { cout<<"Shape draw"<<endl; }
};
class Rectangle : public Shape
{
public:
Rectangle(void) {}
~Rectangle(void) {}
void draw(void) const { cout<<"Rectangle draw"<<endl; }
};
class Ellipse : public Shape
{
public:
Ellipse(void) {}
~Ellipse(void) {}
};
int _tmain(int argc, char* argv[])
{
Shape *pr = new Rectangle;
pr->draw();
pr->Shape::draw();
delete pr;
pr = NULL;
Shape *pe = new Ellipse;
pe->draw();
delete pe;
pe = NULL;
return 0;
}
--------------------Configuration: virturnl - Win32
Debug--------------------
Linking...
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/virturnl.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
virturnl.exe - 2 error(s), 0 warning(s)
************************************************
My IDE tool is VC++6.0 , when i want to build the code, the errors will
display when it linked. but i have never meet the error , have anyone known
whats wrong with it and give me an advice , thanks
#include <iostream>
#include <string>
using namespace std;
class Shape
{
public:
Shape(void) {}
~Shape(void) {}
virtual void draw(void) const { cout<<"Shape draw"<<endl; }
};
class Rectangle : public Shape
{
public:
Rectangle(void) {}
~Rectangle(void) {}
void draw(void) const { cout<<"Rectangle draw"<<endl; }
};
class Ellipse : public Shape
{
public:
Ellipse(void) {}
~Ellipse(void) {}
};
int _tmain(int argc, char* argv[])
{
Shape *pr = new Rectangle;
pr->draw();
pr->Shape::draw();
delete pr;
pr = NULL;
Shape *pe = new Ellipse;
pe->draw();
delete pe;
pe = NULL;
return 0;
}
--------------------Configuration: virturnl - Win32
Debug--------------------
Linking...
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/virturnl.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
virturnl.exe - 2 error(s), 0 warning(s)
************************************************
My IDE tool is VC++6.0 , when i want to build the code, the errors will
display when it linked. but i have never meet the error , have anyone known
whats wrong with it and give me an advice , thanks