fatal error LNK1120 && error LNK2001: unresolved external symbol _WinMain@16
#include<stdio.h>
#include<stdlib.h>
#include"genlib.h"
#define NTrials 10
main()
{
int i,r;
printf("On this computer,RAND_MAX = %d.\n",RAND_MAX);
printf("Here are the results of %d calls to rand:\n",NTrials);
for(i=0;i<NTrials;i++)
{
r=rand();
printf("%10d\n",r);
}
getchar();
}
编译后就会出现下列错误:
Linking...
LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16
Debug/randtest.exe : fatal error LNK1120: 1 unresolved externals
执行 link.exe 时出错.
这是不是哪里的设置有问题呢
[解决办法]
未解析的外部符号_WinMain@16, 有可能是你工程建错了。你建的是个Win32 Project 工程,写的却是Win32 Console Project.