1. 設置環境變量path:
例如:C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools2. cmd,定位到源代碼目錄,運行vsvars32.bat
3. cl.exe /c test.c
#include <windows.h>
int APIENTRY wWinMain(_In_ HINSTANCE hInstance,
_In_opt_ HINSTANCE hPrevInstance,
_In_ LPWSTR lpCmdLine,
_In_ int nCmdShow)
{
MessageBox(NULL, "Hello Win32", "sdk", MB_ABORTRETRYIGNORE | MB_ICONERROR);
return 0;
}
4. link.exe test.obj user32.lib參考:
https://blog.csdn.net/hyman_c/article/details/53141662
https://blog.csdn.net/laogaoav/article/details/9060089