求助求助!!!!!

BoredNight 2011-07-11 11:06:18
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
...全文
462 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
周晶晶Joyce 2014-03-08
  • 打赏
  • 举报
回复
同求!!!!
BoredNight 2011-07-11
  • 打赏
  • 举报
回复
是不是什么库没有设好啊?T T来点人帮忙看看吧。。。
BoredNight 2011-07-11
  • 打赏
  • 举报
回复
这段代码是建完文件自动生成的不是我写的T T
BoredNight 2011-07-11
  • 打赏
  • 举报
回复
写错了。。是windows窗体。。。我只是建了一个windows窗体,什么都没加呢就不能编译了
至善者善之敌 2011-07-11
  • 打赏
  • 举报
回复
System::ComponentModel::Container ^components;这是什么写法?
bdmh 2011-07-11
  • 打赏
  • 举报
回复
没法弄了,一个个自己解决吧,有一些还是提示很明显的

64,647

社区成员

发帖
与我相关
我的任务
社区描述
C++ 语言相关问题讨论,技术干货分享,前沿动态等
c++ 技术论坛(原bbs)
社区管理员
  • C++ 语言社区
  • encoderlee
  • paschen
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
  1. 请不要发布与C++技术无关的贴子
  2. 请不要发布与技术无关的招聘、广告的帖子
  3. 请尽可能的描述清楚你的问题,如果涉及到代码请尽可能的格式化一下

试试用AI创作助手写篇文章吧