I am trying to compile a simple Windows API C program using the Windows SDK command line.
Here is an excerpt from the program:
#include <Windows.h> int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { [...] RegisterClass(&wc); hwnd = CreateWindow("test", NULL, 0, 0, 0, 0, 0, NULL, NULL, hInstance, NULL); [...]
When I compile it with
cl test.c
at the Windows SDK Command prompt, this gives me a lot of linker errors, such as:
test.obj : error LNK2019: unresolved external symbol __imp_CreateWindowExA referenced in function WinMain test.obj : error LNK2019: unresolved external symbol __imp_RegisterClassA referenced in function WinMain
source share