All function you didn't personally write have to be linked to complete your prorgram. Calls like strcpy(), printf(), etc come from the C runtime (CRT). Visual C++ will be configured to link these when you create a new project. But if you use functonality not normally used in a console app, you need to edit the linker properties of you project to add the extra, required libraries.
Linker Property Pages
http://msdn.microsoft.com/en-us/library/024awkd1%28v=VS.90%29.aspx
(this is for the 2008 version: follow links to other versions if required)
You can provide the linker with two types of libraries:
- Static libraries contains all the machine code for the functions, so you final application includes the code for all the functions you use (though these functions can call functions in DLLs).
- Import libraries just provide the information about where the function comes from -- a DLL -- so when you use this kind of llibrary you need to provide the necessary DLLs when you distribute your app. (A static library provides the data needed for the linker to create entries in its import table, which is what the system uses to resolve dependencies when it load you app).
In the case of User32.lib, you are using an import library. But as User32.dll is a standard part of the operating system, you don't have to worry too much about it (you do have to worry the function you want to use has only been introduced in a more recebt version of Windows).
Andy