Ant-Veil

Caspar Blog

编译错误索引

| Comments

编译软件在 Linux 的软件安装方式中有着重要角色,最常用的就是使用“编译三部曲”:
./configure (配置环境,生成 Makefile)
make (编译链接,生成可执行文件或库)
make install (将生成的文件复制到对应的路径下)

而在 configure 阶段会产生各种各样的错误,大都是由于没有对应的类库而造成的。本文以 Ubuntu 为例列出如下索引:

错误信息:C compiler cannot create executables
错误信息:C++ preprocessor "/lib/cpp" fails sanity check
错误分析:以上两条信息都是由于 C/C++编译组件没有安装完全导致的。在 Ubuntu 下有一个 build-essential 包,可以一次性将 C/C++编译包安装完全。
sudo apt-get install build-essential
错误信息:Can't find X includes. Please check your installation and add the correct paths!
错误分析:没有 X(图形界面)的包含文件。可以安装 xlibs-dev 解决此问题,也可以安装 xorg-dev 一次性安装所有的 Xorg 相关的包。
sudo apt-get install xlibs-dev
sudo apt-get install xorg-dev
错误信息:Qt (>= Qt 3.0) (headers and libraries) not found. Please check your installation!
sudo apt-get install libqt3-headers libqt3-mt-dev
错误信息:in the prefix, you've chosen, are no KDE headers installed. This will fail.So, check this please and use another prefix!
sudo apt-get install kdelibs4-dev kdelibs4c2a
错误信息:autoconf: not found
sudo apt-get install autoconf
错误信息: *** GTK >= 2.4.0 not installed! ***
sudo apt-get build-dep gedit
错误信息:Cannot find GTK: Is gtk-config in path?
sudo apt-get install libgtk1.2-dev
错误信息:No package 'gtk+-2.0' found
错误信息:No package 'gtksourceview-1.0' found
错误信息:No package 'libgnomeui-2.0' found
错误信息:No package 'libglade-2.0' found
错误信息:No package 'libgnomeprintui-2.2' found
sudo apt-get install libgtk2.0-dev libgtksourceview-dev libgnomeui-dev libglade2-dev libgnomeprint2.2-dev
错误信息:No package 'libpanelapplet-2.0' found
sudo apt-get install libpanelappletmm-2.6-dev
错误信息:You must have the GTK+ 2.0 development headers installed to compile ***.
sudo apt-get install libgtk2.0-dev
错误信息:You must have libxml2 >= 2.6.0 development headers installed to build.
sudo apt-get install libxml2-dev
错误信息:wxWidgets must be installed on your system but wx-config script couldn't be found. ...
sudo apt-get install libwxbase2.6-dev libwxgtk2.6-dev
错误信息: Header file pcap.h not found;
sudo apt-get install libpcap-dev

Comments