使用 GetProcessTimes 和 FileTimeToSystemTime 的 CPU 处理时间在 64 位 win 中不起作用 [英] CPU Process time using GetProcessTimes and FileTimeToSystemTime do not work in 64 bit win

查看:21
本文介绍了使用 GetProcessTimes 和 FileTimeToSystemTime 的 CPU 处理时间在 64 位 win 中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试测量 CPU 时间.它在 Win 32 上运行良好,但在 64 位上,它说:

I am trying to measure CPU time. It works great on Win 32, but on 64 bit, it says:

error LNK2019: unresolved external symbol __imp_GetProcessTimes referenced in function "unsigned int __cdecl getWINTime(void)" (?getWIN32Time@@YAIXZ) 

FileTimeToSystemTime

error LNK2019: unresolved external symbol __imp_FileTimeToSystemTime referenced in function "unsigned int __cdecl getWINTime(void)" (?getWIN32Time@@YAIXZ)

功能本身并不重要,没有问题.
这是 64 位架构中的合法调用还是什么?

Function itself is not that important there is no issue with it.
Are this calls legit in 64 bit architecture or what?

这不是唯一的问题,它似乎没有正确链接到 64 位 Windows 上的库.
有没有我应该设置它才能正确链接的设置?

This is not the only issue it seems like its not linking correctly to libraries on 64 bit windows.
Is there a setting I should set for it to link properly?

推荐答案

您是否为两个环境的构建设置列出了相同的导入库.这两个函数都在 kernel32.dll 中.

Do you're build settings for the two environments have the same import libraries listed. Both of those functions are in kernel32.dll.

这篇关于使用 GetProcessTimes 和 FileTimeToSystemTime 的 CPU 处理时间在 64 位 win 中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆