I'm trying to implement this example process enumerator program from MSDN
I am getting numerous errors for unresolved symbols, including
undefined reference to `EnumProcessModules@16'
MSDN seems to have anticipated these issues and included some instructions in the comments, but I am unfamiliar with what they mean and how to implement them. Unfortunately, the MSDN page on TARGETLIBS is not very specific.
// To ensure correct resolution of symbols, add Psapi.lib to TARGETLIBS
// and compile with -DPSAPI_VERSION=1
How do I add Psapi.lib to TARGETLIBS? I've downloaded the Windows SDK and know the path to Psapi.lib on my computer (I actually seem to have 4 copies of it in the SDK folders, for different processor architectures). I also have a copy of psapi.a in my MinGW/lib folder.