L
laolor
Unregistered / Unconfirmed
GUEST, unregistred user!
我想定义一个类Graph,可以初始化一个对象Graph ThisGraph;
然后我选择直线时,在赋值:ThisGraph=ThisLINE;有下面的类定义:
class Graph
{virtual ~Graph()=0;}
class LINE
{~LINE()}
但是这样就不能初始化Graph对象,如果写成virtual ~Graph();则出错为:
[Linker Error] Unresolved external 'Graph::~Graph()' referenced from E:/GRAPHICS/MAIN.OBJ.
怎样才能,既可初始化Graph实例,又能正确析构?
然后我选择直线时,在赋值:ThisGraph=ThisLINE;有下面的类定义:
class Graph
{virtual ~Graph()=0;}
class LINE
{~LINE()}
但是这样就不能初始化Graph对象,如果写成virtual ~Graph();则出错为:
[Linker Error] Unresolved external 'Graph::~Graph()' referenced from E:/GRAPHICS/MAIN.OBJ.
怎样才能,既可初始化Graph实例,又能正确析构?