[英]“Error LNK2001: unresolved external symbol _main” still exists
I know similar question is already been made but none of the answers helped me. 我知道已经提出了类似的问题,但是没有一个答案对我有帮助。
I get this error : 我收到此错误:
MSVCRT.lib(exe_main.obj) : error LNK2001: unresolved external symbol _main MSVCRT.lib(exe_main.obj):错误LNK2001:无法解析的外部符号_main
I am using VS17. 我正在使用VS17。 I created a Wizard Console Application and a Static Lib.
我创建了一个向导控制台应用程序和一个静态库。
My A.cpp also looks like this 我的A.cpp也像这样
#include <iostream>
#include "A.h"
namespace img{
int main(int argc, char* argv[]{
...
return 0;
}
}
I tried changing the Properties of the Project as many suggested but everything looks fine. 我尝试按照许多建议更改项目的属性,但一切看起来都很好。
根据转换需要在全局名称空间中定义main。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.