关于Microsoft Visual C++ 2010 Express(学习版)的问题。

“MSVCRTD.lib(crtexew.obj) : error LNK2019: 无法解析的外部符号 _WinMain@16,该符号在函数 ___tmainCRTStartup 中被引用”提示这个错误。。。。下面我放上我操作的截图和代码。

代码:
#pragma comment(linker,"/subsystem:windows")

// myfirst.cpp--displays a message

#include <iostream> // a PREPROCESSOR directive
int main() // function header
{ // start of function body
using namespace std; // make definitions visible
cout << "Come up and C++ me some time."; // message
cout << endl; // start a new line
cout << "You won't regret it!" << endl; // more output
// If the output window closes before you can read it,
// add the following code:
// cout << "Press any key to continue." <<endl;
// cin.get();
return 0; // terminate main()
} // end of function body

希望大神帮我解决,快被这个搞死了,刚开始学就动不了了。。。。。。

第1个回答  2015-01-08
把#pragma comment(linker,"/subsystem:windows")删掉
第2个回答  2015-01-08
把你的#pragma行删除了,谁告诉你空项目加这一行的?
如果你要加这一行,你的主函数应该是WinMain,而不是main
对于windows下的C++不是很了解
第3个回答  2015-01-08
第一行删除就OK了。你建项目的时候可以选择让他自动生成预编译头啊,这样就只用管主函数了本回答被提问者采纳
第4个回答  2015-01-08
重装系统 不然的话 如果你再重新装vs 可能会出现 上次卸载不完全 导致未知问题追问

意思是我需要重装系统。但是如果我卸载VC的话可能会出现卸载不完全,所以要重装系统吧?

相似回答