积极答复者
VS2012编译win程序出错LNK2019: 无法解析的外部符号 _WinMain@16,如何解决

问题
-
我用的是VS Express 2012for Windows Desktop版的
我是新建的CLR空项目,之后在项目中新建windows窗体项,编辑窗体后运行出错如下
1 error LNK2019: 无法解析的外部符号 _WinMain@16,该符号在函数 ___tmainCRTStartup 中被引用 D:\Users\李萌\Documents\Visual Studio 2012\Projects\Project1\Project1\MSVCRTD.lib(crtexew.obj) Project1error LNK1120: 1 个无法解析的外部命令
上网查到的都是以下解决方法:
1.进入project->setting->c/c++, 在category中选择preprocessor,在processor
definitions中删除_CONSOLE, 添加_WINDOWS
2.进入project->setting->Link,
在Project options中将 /subsystem:console改为/subsystem:windows.也没用
如何解决啊?
答案
-
- 已建议为答案 Elegentin XieModerator 2012年12月10日 4:42
- 取消建议作为答案 Elegentin XieModerator 2012年12月10日 4:43
- 已编辑 Damon ZhengModerator 2012年12月10日 10:40 mark
全部回复
-
- 已建议为答案 Elegentin XieModerator 2012年12月10日 4:42
- 取消建议作为答案 Elegentin XieModerator 2012年12月10日 4:43
- 已编辑 Damon ZhengModerator 2012年12月10日 10:40 mark
-
属性->链接器->高级->入口点是空的,添什么?
把main添加进去就可以了。Damon Zheng
MSDN Community Support | Feedback to us
Develop and promote your apps in Windows Store
Please remember to mark the replies as answers if they help and unmark them if they provide no help.