求助求助!!!!!
C++新人。。
今天尝试在VS2010里面建一个GUI, 用的windows 控件。然后发现控件的代码完全不能编译啊。。。
protected:
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
~gui()
{
if (components)
{
delete components;
}
}
private:
/// <summary>
/// 必需的设计器变量。
/// </summary>
System::ComponentModel::Container ^components;
#pragma region Windows Form Designer generated code
/// <summary>
/// 设计器支持所需的方法 - 不要
/// 使用代码编辑器修改此方法的内容。
/// </summary>
void InitializeComponent(void)
{
this->SuspendLayout();
//
// gui
//
this->AutoScaleDimensions = System::Drawing::SizeF(8, 15);
this->AutoScaleMode = System::Windows::Forms::AutoScaleMode::Font;
this->ClientSize = System::Drawing::Size(282, 255);
this->Name = L"gui";
this->Text = L"gui";
this->Load += gcnew System::EventHandler(this, &gui::gui_Load);
this->ResumeLayout(false);
}
#pragma endregion
private: System::Void gui_Load(System::Object^ sender, System::EventArgs^ e) {
}
};
}
这个是刚建完一个windows控件文件后窗口的代码(.h文件里面的),编译的话就报错
错误 1 error LNK2019: 无法解析的外部符号 _main,该符号在函数 ___tmainCRTStartup 中被引用 C:\Users\Tomsheng\Documents\Visual Studio 2010\Projects\study\study\MSVCRTD.lib(crtexe.obj) study
错误 2 error LNK1120: 1 个无法解析的外部命令 C:\Users\Tomsheng\Documents\Visual Studio 2010\Projects\study\Debug\study.exe 1 1 study
3 IntelliSense: 名称必须是命名空间名 c:\users\tomsheng\documents\visual studio 2010\projects\study\study\gui1.h 5 18 study
4 IntelliSense: 后面有“::”的名称一定是类名或命名空间名 c:\users\tomsheng\documents\visual studio 2010\projects\study\study\gui1.h 6 18 study
5 IntelliSense: 后面有“::”的名称一定是类名或命名空间名 c:\users\tomsheng\documents\visual studio 2010\projects\study\study\gui1.h 7 18 study
6 IntelliSense: 后面有“::”的名称一定是类名或命名空间名 c:\users\tomsheng\documents\visual studio 2010\projects\study\study\gui1.h 8 18 study
7 IntelliSense: 后面有“::”的名称一定是类名或命名空间名 c:\users\tomsheng\documents\visual studio 2010\projects\study\study\gui1.h 9 18 study
8 IntelliSense: 后面有“::”的名称一定是类名或命名空间名 c:\users\tomsheng\documents\visual studio 2010\projects\study\study\gui1.h 10 18 study
9 IntelliSense: 应输入声明 c:\users\tomsheng\documents\visual studio 2010\projects\study\study\gui1.h 15 2 study
10 IntelliSense: “this”只能用于非静态成员函数内部 c:\users\tomsheng\documents\visual studio 2010\projects\study\study\gui1.h 51 4 study
11 IntelliSense: “this”只能用于非静态成员函数内部 c:\users\tomsheng\documents\visual studio 2010\projects\study\study\gui1.h 55 4 study
12 IntelliSense: 后面有“::”的名称一定是类名或命名空间名 c:\users\tomsheng\documents\visual studio 2010\projects\study\study\gui1.h 55 32 study
13 IntelliSense: “this”只能用于非静态成员函数内部 c:\users\tomsheng\documents\visual studio 2010\projects\study\study\gui1.h 56 4 study
14 IntelliSense: 后面有“::”的名称一定是类名或命名空间名 c:\users\tomsheng\documents\visual studio 2010\projects\study\study\gui1.h 56 26 study
15 IntelliSense: “this”只能用于非静态成员函数内部 c:\users\tomsheng\documents\visual studio 2010\projects\study\study\gui1.h 57 4 study
16 IntelliSense: 后面有“::”的名称一定是类名或命名空间名 c:\users\tomsheng\documents\visual studio 2010\projects\study\study\gui1.h 57 23 study
17 IntelliSense: “this”只能用于非静态成员函数内部 c:\users\tomsheng\documents\visual studio 2010\projects\study\study\gui1.h 58 4 study
18 IntelliSense: “this”只能用于非静态成员函数内部 c:\users\tomsheng\documents\visual studio 2010\projects\study\study\gui1.h 59 4 study
19 IntelliSense: “this”只能用于非静态成员函数内部 c:\users\tomsheng\documents\visual studio 2010\projects\study\study\gui1.h 60 4 study
20 IntelliSense: 未定义标识符 "gcnew" c:\users\tomsheng\documents\visual studio 2010\projects\study\study\gui1.h 60 18 study
21 IntelliSense: 应输入“;” c:\users\tomsheng\documents\visual studio 2010\projects\study\study\gui1.h 60 24 study
22 IntelliSense: “this”只能用于非静态成员函数内部 c:\users\tomsheng\documents\visual studio 2010\projects\study\study\gui1.h 61 4 study
23 IntelliSense: 应输入声明 c:\users\tomsheng\documents\visual studio 2010\projects\study\study\gui1.h 65 2 study
24 IntelliSense: 应输入声明 c:\users\tomsheng\documents\visual studio 2010\projects\study\study\gui1.h 68 1 study
求问怎么解决啊,是不是要include什么还是要怎么样啊?
跪谢!T T