gpt4 book ai didi

c++ - 使用 GetProcessTimes 和 FileTimeToSystemTime 的 CPU 处理时间在 64 位 win 中不起作用

转载 作者:行者123 更新时间:2023-11-28 01:11:12 29 4
gpt4 key购买 nike

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

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 位架构中是合法的还是什么?

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

最佳答案

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

关于c++ - 使用 GetProcessTimes 和 FileTimeToSystemTime 的 CPU 处理时间在 64 位 win 中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3071652/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com