undefined reference to CallNtPowerInformation

觅路人 2017-04-25 11:26:03
C++程序在調用CallNtPowerInformation是显示“undefined reference to CallNtPowerInformation”,头文件包含
#include <stdio.h>
#include <cstdlib>
#include <Windows.h>

#ifdef __cplusplus
extern "C" {
#endif
#include <Powrprof.h>
#ifdef __cplusplus
}
#endif

#define GetCPUTickCount() __rdtsc()

主要用来计算CPU的工作频率,但是在调用CallNtPowerInformation时出现问题
...全文
302 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
觅路人 2017-05-15
  • 打赏
  • 举报
回复
谢谢,问题已解决,将Powrprof.h放到工程文件内,后者在codeblocks内编译设置内Linker Setting内引入此库
  • 打赏
  • 举报
回复
这段不需要啊 #ifdef __cplusplus extern "C" { #endif #include <Powrprof.h> #ifdef __cplusplus } #endif 直接 #include <Powrprof.h>

1,221

社区成员

发帖
与我相关
我的任务
社区描述
C++ Builder Windows SDK/API
社区管理员
  • Windows SDK/API社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧