我有以下类:的Visual C++ 2010错误:LNK2020无法解析令牌
public ref class Form1 : public System::Windows::Forms::Form
{
//[...]
protected:
System::Void label1_Click(System::Object^ sender, System::EventArgs^ e);
};
public ref class Functions : public Form1
{
protected:
void Example() {}
};
public ref class Handlers : public Functions
{
private:
System::Void label1_Click(System::Object^ sender, System::EventArgs^ e)
{
Example();
}
};
正如你可以看到我想我的extern方法引入额外的类。 错误是:
1>Milionerzy.obj : error LNK2020: unresolved token (06000004) Milionerzy.Form1::label1_Click
什么是错?
您需要为'Form1中:: label1_Click'提供的定义或声明它纯虚。 –
我正在尝试纯虚拟类Form1 [code] virtual System :: Void label1_Click(System :: Object^sender,System :: EventArgs^e)= 0; [/ code] 而我有很多错误。我使用这个解决方案: [link] http://stackoverflow.com/questions/2652198/difference-between-a-virtual-function-and-a-pure-virtual-function [/ link] – Zomfire
1> c :\ users \ michal \ documents \ visual studio 2010 \ projects \ milionerzy \ milionerzy \ Form1.h(505):参见'Milionerzy :: Form1 :: label1_Click'的声明1''void Milionerzy :: Form1 :: label2_Click System :: Object ^,System :: EventArgs ^)':is abstract – Zomfire