你如何知道 Ubuntu 上安装了哪个版本的 GTK+? [英] How do you find out which version of GTK+ is installed on Ubuntu?

查看:81
本文介绍了你如何知道 Ubuntu 上安装了哪个版本的 GTK+?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要确定在 Ubuntu 上安装了哪个版本的 GTK+

I need to determine which version of GTK+ is installed on Ubuntu

男人似乎没有帮助

推荐答案

这个建议 会告诉你 2.0 是哪个次要版本已安装.不同的主要版本会有不同的包名,因为它们可以在系统上共存(以支持使用旧版本构建的应用程序).

This suggestion will tell you which minor version of 2.0 is installed. Different major versions will have different package names because they can co-exist on the system (in order to support applications built with older versions).

即使对于开发文件,通常只能让您在系统上拥有一个版本,您也可以在同一系统上拥有一个 gtk 1.x 版本和一个 gtk 2.0 版本(包含文件位于名为 gtk 的目录中-1.2 或 gtk-2.0).

Even for development files, which normally would only let you have one version on the system, you can have a version of gtk 1.x and a version of gtk 2.0 on the same system (the include files are in directories called gtk-1.2 or gtk-2.0).

简而言之,系统上的 GTK 版本是什么"并没有简单的答案.但是...

So in short there isn't a simple answer to "what version of GTK is on the system". But...

尝试以下操作:

dpkg -l libgtk* | grep -e '^i' | grep -e 'libgtk-*[0-9]'

列出系统上的所有 libgtk 包,包括 -dev 包.dpkg -l 将列出 dpkg 知道的所有软件包,包括当前未安装的软件包,因此我使用 grep 仅列出已安装的软件包(行以 i 开头).

to list all the libgtk packages, including -dev ones, that are on your system. dpkg -l will list all the packages that dpkg knows about, including ones that aren't currently installed, so I've used grep to list only ones that are installed (line starts with i).

或者,如果您感兴趣的标头版本等可能更好,请使用 pkg-config:

Alternatively, and probably better if it's the version of the headers etc that you're interested in, use pkg-config:

pkg-config --modversion gtk+

会告诉你安装了哪个版本的 GTK 1.x 开发文件,以及

will tell you what version of GTK 1.x development files are installed, and

pkg-config --modversion gtk+-2.0

会告诉你什么版本的 GTK 2.0.旧的 1.x 版本也有自己的 gtk-config 程序来做同样的事情.同样,对于 GTK+ 3:

will tell you what version of GTK 2.0. The old 1.x version also has its own gtk-config program that does the same thing. Similarly, for GTK+ 3:

pkg-config --modversion gtk+-3.0

这篇关于你如何知道 Ubuntu 上安装了哪个版本的 GTK+?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆