我想这实际上很简单,但由于我是 C++ 的新手,我无法理解我做错了什么。 大多数答案(如 this question 的答案)都表明:
project name -> Properties -> Expand Linker tab -> System -> SubSystem:
并将子系统更改为不同的类型。我试过了,但它给了我另一个错误:
fatal error LNK1120: 1 unresolved externals
所以我认为这是一种错误的方式。
当我创建项目时,我选择了 Visual C++ -> General -> Empty Project
。
我的主要方法是 int main();
和 return 0;
。我之前在 Eclipse
中做过,一切都很好。
拜托,我应该配置什么才能成功启动我的项目?谢谢。
这是它的样子:
#include <iostream>
using namespace std;
class Source{
int main(){
cout << "out" << endl;
return 0;
}
};
最佳答案
我想你可以把它改成:
#include <iostream>
using namespace std;
//class Source{
int main()
{
cout << "out" << endl;
return 0;
}
//};
关于c++ - 安装 Visual Studio 2013 后的第一个构建错误。 fatal error LNK1561 : entry point must be defined,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30242001/