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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值