欢迎访问 生活随笔!

生活随笔

当前位置: 首页 > 编程资源 > 编程问答 >内容正文

编程问答

MSDN中Enumerating All Processes枚举所有进程事例编译错误解析办法

发布时间:2023/12/20 编程问答 39 豆豆
生活随笔 收集整理的这篇文章主要介绍了 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枚举所有进程事例编译错误解析办法的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。