我是ubuntu的新手,我目前正在使用vmware工作站的Windows 7上使用它。
我需要在终端上使用C程序访问CPU使用率,所以我想在glibtop库上使用glibtop_get_cpu()
函数。我刚刚在我的代码中写了#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
关于这个的任何想法?
答案 0 :(得分:1)
您应该安装libgtop2-dev(sudo apt-get install libgtop2-dev
)。