Search code examples
c++windows32bit-64bitcpu-time

CPU Process time using GetProcessTimes and FileTimeToSystemTime do not work in 64 bit win


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) 

It has similar error for FileTimeToSystemTime

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

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

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?


Solution

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