简体   繁体   English

视觉工作室致命错误LNK1120:

[英]visual studio fatal error LNK1120:

just i wanted to make a program using viual stidio 2010 when i do build i have this excaption i just wrote empty main c++ program (no syntax errors) 只是我想用viual stidio 2010做一个程序,当我构建我有这个excaption我刚写了空主c ++程序(没有语法错误)

what i got is: 我得到的是:

1>LINK : error LNK2001: unresolved external symbol _mainCRTStartup
1>c:\users\dell\documents\visual studio 2010\Projects\test\Debug\test.exe : 
fatal error LNK1120: 1 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

code is : 代码是:

#include <iostream>
using namespace std;

int main()
{
    cout << "Hello World" << endl; 
    return 0;
}

please help me to fix it asap thanks ,, 请帮助我尽快解决它,谢谢,

You created a Win32-Project! 你创建了一个Win32项目! Make sure that you choose Console Application in the project wizard. 确保在项目向导中选择“控制台应用程序”。

Look at your project property. 看看你的项目属性。 Just go to project settings, linker settings, then system. 只需转到项目设置,链接器设置,然后转到系统。 Check your subsystem setting.You can change subsystem to "not set".It will link based on which entry point function you have defined. 检查子系统设置。您可以将子系统更改为“未设置”。它将根据您定义的入口点功能进行链接。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM