c - 在ubuntu上安装glibtop

标签 c ubuntu glib

我是 ubuntu 新手,目前正在 Windows 7 上使用 vmware 工作站。 我需要在终端上使用 C 程序来访问 CPU 使用情况,所以我想到使用 glibtop_get_cpu() glitop 库上的函数。我刚刚写了#include <glibtop.h>在我的代码中并在终端上使用“gcc”编译它,它说

fatal error: glibtop.h: No such file or directory
compilation terminated.

我尝试使用以下方法安装库:

sudo apt-get install liblib2.0-dev

但是终端说:

Reading package lists... Done
Building dependency tree
Reading state information... Done
Package libglib2.0-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or is only available from another source
However the following packages replace it:
libglib2.0-0 libglib2.0-bin
E: Package 'libglib2.0-dev' has no installation candidate

对此有什么想法吗?

最佳答案

您应该安装 libgtop2-dev (sudo apt-get install libgtop2-dev)。

关于c - 在ubuntu上安装glibtop,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34576160/

相关文章:

perl - 如何计算 Perl 中出现的奇数次?

c++ - Opencv 中的 PCA 项目和反向项目

c - GtkListStore 添加(段错误)

glib - 几秒钟后 Vala 隐藏 Gtk.InfoBar

c - 跟踪这个文件

objective-c - 目标 - C - << 在枚举中的使用

c - sscanf() 将十六进制整数转换为整数数组与无符号字符

iphone - 我可以安全地将 UInt32 存储到 NSInteger 吗?

javascript - .css 文件,::第一行不可能。如何做到这一点? Ubuntu 18.04

javascript - 在 JavaScript 中创建动态重新调度 GSource