MSDN中Enumerating All Processes枚举所有进程事例编译错误解析办法
生活随笔
收集整理的這篇文章主要介紹了
MSDN中Enumerating All Processes枚举所有进程事例编译错误解析办法
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
?
MSDN中http://msdn.microsoft.com/en-us/library/ms682629(VS.85).aspx 枚舉全部進程事例代碼編譯出現如下錯誤的原因及解決辦法Processes.obj : error LNK2019: unresolved external symbol _GetModuleBaseNameW@16 referenced in function "void __cdecl PrintProcessNameAndID(unsigned long)" (?PrintProcessNameAndID@@YAXK@Z)Processes.obj : error LNK2019: unresolved external symbol _EnumProcessModules@16 referenced in function "void __cdecl PrintProcessNameAndID(unsigned long)" (?PrintProcessNameAndID@@YAXK@Z)Processes.obj : error LNK2019: unresolved external symbol _EnumProcesses@12 referenced
解決辦法:其實就是少了Psapi.lib庫? 添加進去就好了
You have to tell the linker to use Psapi.lib for those undefined functions.
I don't see any mention of which compiler and version you're using.
If you expect exact suggestions you will have to provide exact details.
VS2008進行如下操作、相信VS2005也是一樣的
For VC++ 2008 you can add Psapi.lib to the list of files used as input by the
linker by drilling down into the Project Properties to Configuration Properties,
Linker, Input and then adding Psapi.lib to the "Additional Dependencies".
轉載于:https://www.cnblogs.com/eping/archive/2009/02/15/1391018.html
總結
以上是生活随笔為你收集整理的MSDN中Enumerating All Processes枚举所有进程事例编译错误解析办法的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: WCF安全指南发布
- 下一篇: ISA Server 2006速战速决实