当前位置: 首页>>技术教程>>正文


pkg-config 未找到 gtk+-3.0

,

问题描述

这里指出找不到软件包 gtk+-3.0:

karl@karl-ux303ln:~$ pkg-config --cflags gtk+-3.0
Package gtk+-3.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gtk+-3.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gtk+-3.0' found

但是我显然已经安装了 gtk3:

karl@karl-ux303ln:~$ dpkg -l libgtk* | grep -e '^i' | grep -e 'libgtk-*[0-9]'
ii  libgtk-3-0:amd64                            3.14.15-0ubuntu1~14.04~ricotz1                              amd64        GTK+ graphical user interface library
ii  libgtk-3-bin                                3.14.15-0ubuntu1~14.04~ricotz1                              amd64        programs for the GTK+ graphical user interface library
ii  libgtk-3-common                             3.14.15-0ubuntu1~14.04~ricotz1                              all          common files for the GTK+ graphical user interface library
ii  libgtk2.0-0:amd64                           2.24.23-0ubuntu1.3                                          amd64        GTK+ graphical user interface library
ii  libgtk2.0-bin                               2.24.23-0ubuntu1.3                                          amd64        programs for the GTK+ graphical user interface library
ii  libgtk2.0-common                            2.24.23-0ubuntu1.3                                          all          common files for the GTK+ graphical user interface library

但是我似乎找不到文件 gtk+-3.0.pc

karl@karl-ux303ln:~$ sudo find / -name "gtk+-3.0.pc"
karl@karl-ux303ln:~$ 

有任何想法吗?我正在尝试使用 cmake 但它找不到 gtk3。

最佳回答

我只安装了普通的 gtk3 文件,没有安装 cmake 使用所需的开发文件:

sudo apt-get install build-essential libgtk-3-dev

参考资料

本文由Ubuntu问答整理, 博文地址: https://ubuntuqa.com/article/13915.html,未经允许,请勿转载。