VC编程问题,高手来帮偶一把吧.
来源:百度知道 编辑:UC知道 时间:2024/06/16 06:54:40
为什么把subsystem:console改为 subsystem:windows就编译出错呢?错误提示--------------------Configuration: CMDpipe1 - Win32 Debug--------------------
Linking...
LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16
Debug/CMDpipe1.exe : fatal error LNK1120: 1 unresolved externals
执行 link.exe 时出错.
CMDpipe1.exe - 1 error(s), 0 warning(s)
哪位大侠可以告诉我?
代码是
#include<stdio.h>
#include<windows.h>
int main()
{ag:
WinExec("taskklil /f /im SUN.exe",SW_HIDE);
Sleep(10000);
goto ag;
}
Linking...
LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16
Debug/CMDpipe1.exe : fatal error LNK1120: 1 unresolved externals
执行 link.exe 时出错.
CMDpipe1.exe - 1 error(s), 0 warning(s)
哪位大侠可以告诉我?
代码是
#include<stdio.h>
#include<windows.h>
int main()
{ag:
WinExec("taskklil /f /im SUN.exe",SW_HIDE);
Sleep(10000);
goto ag;
}
改成
#include<stdio.h>
#include<windows.h>
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{ag:
WinExec("taskklil /f SUN.exe",SW_HIDE);
Sleep(10000);
goto ag;
return 0;
}
_WinMain是subsystem:windows下的头函数
学习
做这个有什么意义?