我想获取计算机的物理安装 RAM 以及其他系统信息。
当我尝试编译代码时,它会给出错误“对 GetPhysicallyInstalledSystemMemory
的 undefined reference ”以及一条警告,指出这是一个隐式声明。
我正在使用 Code::Blocks 17.12 和最新的 GCC。
#define WINVER 0x0A00
#define _WIN32_WINNT 0x0A00
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
int main()
{
long ram;
BOOL Checkram;
Checkram = GetPhysicallyInstalledSystemMemory(&ram);
printf("Installed RAM is: %lu", ram);
return 0;
}
我对 C 编程非常陌生,我确实阅读了 Microsoft 文档,但它仍然没有帮助我解决这个问题。
更新: 我已经用 Visual Studio 编译了它,现在它可以工作了。
最佳答案
我已切换到 Visual Studio,它解决了问题。
关于c - GetPhysicallyInstalledMemory 函数 - C 中 undefined reference ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57006954/