它会告诉你怎样才能成功安装 通常从源码包安装软件的步骤是: tar jxvf gtk+-2.4.13.tar.bz2 解开源码包 cd gtk+-2.4.13/ 进入源码目录 ./configure 似乎在某些环境下./configure会造成终端退出 而使用. configure则会正常运行,如果有这个现象,就试试 . configure
通过configure程序猜测主机信息,最终建立Makefile,以完成make,所以如果./configure不成功 而去make的话,就会出现"make: *** No targets specified and no makefile found. Stop." make 当./configure成功结束后,就开始正式编译程序了. make install 编译成功后使用make install安装 make uninstall 某些软件支持卸载,可能使用该方法卸载,如果支持的话,通常会在README中写到(似乎比较少)
checking for pkg-config... /usr/bin/pkg-config checking for glib-2.0 >= 2.4.0 atk >= 1.0.1 pango >= 1.4.0... Package glib-2.0 was not found in the pkg-config search path. Perhaps you should add the directory containing `glib-2.0.pc' to the PKG_CONFIG_PATH environment variable No package 'glib-2.0' found
configure: error: Library requirements (glib-2.0 >= 2.4.0 atk >= 1.0.1 pango >= 1.4.0) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them. [root@NEWLFS gtk+-2.4.13]# 很明显,上面这段说明,没有找到glib-2.4.x,并且提示应该将glib-2.0.pc加入到PKG_CONFIG_PATH下。 究竟这个pkg-config PKG_CONFIG_PATH glib-2.0.pc 是做什么的呢? let me tell you ^_^ 先说说它是哪冒出来的,当安装了pkgconfig-x.x.x这个包后,就多出了pkg-config,它就是需要PKG_CONFIG_PATH的东东 pkgconfig-x.x.x又是做什么的? 来看一段说明:
Shell代码
The pkgconfig package contains tools for passing the include path and/or library paths to build tools during the make file execution.
pkg-config is a function that returns meta information for the specified library.
The default setting for PKG_CONFIG_PATH is /usr/lib/pkgconfig because of the prefix we use to install pkgconfig. You may add to PKG_CONFIG_PATH by exporting additional paths on your system where pkgconfig files are installed. Note that PKG_CONFIG_PATH is only needed when compiling packages, not during run-time.
The pkgconfig package contains tools for passing the include path and/or library paths to build tools during the make file execution.
pkg-config is a function that returns meta information for the specified library.
The default setting for PKG_CONFIG_PATH is /usr/lib/pkgconfig because of the prefix we use to install pkgconfig. You may add to PKG_CONFIG_PATH by exporting additional paths on your system where pkgconfig files are installed. Note that PKG_CONFIG_PATH is only needed when compiling packages, not during run-time.
我想看过这段说明后,你已经大概了解了它是做什么的吧。 其实pkg-config就是向configure程序提供系统信息的程序,比如软件的版本啦,库的版本啦,库的路径啦,等等 这些信息只是在编译其间使用。你可以 ls /usr/lib/pkgconfig 下,会看到许多的*.pc,用文本编辑器打开 会发现类似下面的信息:
另外./configure 通过,make 出错,遇到这样的问题比较难办,只能凭经验查找原因,比如某个头文件没有找到, 这时候要顺着出错的位置一行的一行往上找错,比如显示xxxx.h no such file or directory 说明缺少头文件 然后去google搜。 或者找到感觉有价值的错误信息,拿到google去搜,往往会找到解决的办法。还是开始的那句话,要仔细看README,INSTALL 程序如何安装,需要什么依赖文件,等等。
所有评论(0)