C ++错误CLR表格请帮帮我急 [英] C++ error CLR form please help me it's urgent

查看:69
本文介绍了C ++错误CLR表格请帮帮我急的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好。我有一个问题,我创建了一个CLR项目并添加了表单,入口点设置为Main,Sub System设置为Windows ... Okey一切都很好,很漂亮。但是当我点击调试时,我收到这个错误

 1> ------ Build build:Project:InfoMEN,Configuration:Debug x64 ---- -  
1> LINK:错误LNK2001:未解析的外部符号Main()
1> c:\Users\gabri\source \repos\InfoMEN \ x64 \ Debug \ InfoMEN.exe:致命错误LNK1120:1未解析的外部
1>完成构建项目InfoMEN.vcxproj - 失败。
==========构建:0成功,1失败,0最新,0跳过==========





我的尝试:



我有找不到该错误的解决方案

解决方案

创建项目时,您做出了错误的应用选择类型。当被问及您的项目是控制台应用程序还是Windows应用程序或DLL或静态库时,您做错了选择了Windows应用程序(错误的选择)。 

返回,重新开始,转到文件 - >新 - >项目 - > Win32控制台应用程序 - >为你的应用命名 - >点击下一步 - >单击应用程序设置

对于应用程序类型,请确保选择了Console Application(此步骤是至关重​​要的步骤)。

Windows应用程序的主要部分称为WinMain,因为DLL称为DllMain,因为.NET应用程序称为Main(cli :: array ^),静态库没有主要。仅在控制台应用程序中主要称为主要





来自MSDN:错误LNK2019:未解析的外部符号_WinMain @ 16在函数___tmainCRTStartup中引用 [ ^ ]


谢谢

 Richard MacCutchan 
你可能主要用小写拼写..NET需要拼写错误上面的消息。


Hi . I have a problem, I created a CLR project and added the form, the entry point set to "Main" and Sub System to Windows ... Okey everything fine and beautiful. But when I click on debugging, I get this error

1>------ Build started: Project: InfoMEN, Configuration: Debug x64 ------
1>LINK : error LNK2001: unresolved external symbol Main()
1>c:\Users\gabri\source\repos\InfoMEN\x64\Debug\InfoMEN.exe : fatal error LNK1120: 1 unresolved externals
1>Done building project "InfoMEN.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========



What I have tried:

I have not found a solution for that error

解决方案

When you created the project, you made the wrong choice of application type. When asked whether your project was a console application or a windows application or a DLL or a static library, you made the wrong chose windows application (wrong choice).

Go back, start over again, go to File -> New -> Project -> Win32 Console Application -> name your app -> click next -> click application settings.

For the application type, make sure Console Application is selected (this step is the vital step).

The main for a windows application is called WinMain, for a DLL is called DllMain, for a .NET application is called Main(cli::array ^), and a static library doesn't have a main. Only in a console app is main called main



From MSDN:error LNK2019: unresolved external symbol _WinMain@16 referenced in function ___tmainCRTStartup[^]


Thank you

Richard MacCutchan 
"You probably have main spelled in lower case. .NET needs it spelled as in the error message above."


这篇关于C ++错误CLR表格请帮帮我急的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆