关于gtk-config和pkg-config的问题

来源:互联网 发布:mhk考试软件 编辑:程序博客网 时间:2024/05/16 08:56





本文参考:http://bbs.chinaunix.net/thread-117432-1-1.html

gtk1.1时代使用gtk-config来配置的

gtk+2.0则用pkg-config来配置,所以如果系统默认安装了gtk+2.0将无法编译一些旧的软件,我在编译gcvs时就有报错:

*** The gtk-config script installed by GTK could not be found
*** If GTK was installed in PREFIX, make sure PREFIX/bin is in
*** your path, or set the GTK_CONFIG environment variable to the
*** full path to gtk-config.


因为软件会检测是否存在gtk-config。

解决方法:
自己编辑一个名为gtk-config的脚本文件,内容如下:
#!/bin/sh
module="gtk+-2.0"
if test "$1" = "--version"; then
        pkg-config --modversion $module
else
        pkg-config $* $module
fi

记得打开文件的一些列执行属性。
即可通过软件安装时的检测。。。。。

原创粉丝点击