ubuntu12.04 make xconfig出错解决
xconfig是linux下X Window环境中用于配制的一个工具,和menuconfig相似,但用法更友好方便,用如下命令可以进入配制界面:
make xconfig
因为在ubuntu系统中,编译内核需要安装一些工具,如makemenuconfig或make xconfig,来配置内核参数,但弹出下面的错误信息:
HOSTCC scripts/basic/fixdep
scripts/basic/fixdep.c:在函数‘traps’中:
scripts/basic/fixdep.c:377:2:警告: 提领类型双关的指针将破坏强重叠规则[-Wstrict-aliasing]
scripts/basic/fixdep.c:379:4:警告: 提领类型双关的指针将破坏强重叠规则[-Wstrict-aliasing]
HOSTCC scripts/basic/docproc
HOSTCC scripts/basic/hash
HOSTCC scripts/kconfig/conf.o
scripts/kconfig/conf.c:在函数‘conf_sym’中:
scripts/kconfig/conf.c:158:6:警告: 变量‘type’被设定但未被使用 [-Wunused-but-set-variable]
scripts/kconfig/conf.c:在函数‘conf_choice’中:
scripts/kconfig/conf.c:230:6:警告: 变量‘type’被设定但未被使用 [-Wunused-but-set-variable]
scripts/kconfig/conf.c:306:9:警告: 忽略声明有warn_unused_result 属性的‘fgets’的返回值 [-Wunused-result]
scripts/kconfig/conf.c:在函数‘conf_askvalue’中:
scripts/kconfig/conf.c:104:8:警告: 忽略声明有warn_unused_result 属性的‘fgets’的返回值 [-Wunused-result]
HOSTCC scripts/kconfig/kconfig_load.o
HOSTCC scripts/kconfig/kxgettext.o
HOSTCC scripts/kconfig/zconf.tab.o
Packageqt-mt was not found in the pkg-config search path.
Perhapsyou should add the directory containing `qt-mt.pc'
to thePKG_CONFIG_PATH environment variable
Nopackage 'qt-mt' found
Packageqt-mt was not found in the pkg-config search path.
Perhapsyou should add the directory containing `qt-mt.pc'
to thePKG_CONFIG_PATH environment variable
Nopackage 'qt-mt' found
Packageqt-mt was not found in the pkg-config search path.
Perhapsyou should add the directory containing `qt-mt.pc'
to thePKG_CONFIG_PATH environment variable
Nopackage 'qt-mt' found
Packageqt-mt was not found in the pkg-config search path.
Perhapsyou should add the directory containing `qt-mt.pc'
to thePKG_CONFIG_PATH environment variable
Nopackage 'qt-mt' found
HOSTCXX scripts/kconfig/qconf.o
scripts/kconfig/qconf.cc:6:26:致命错误: qapplication.h:没有那个文件或目录
编译中断。
make[1]:*** [scripts/kconfig/qconf.o] 错误 1
make:*** [xconfig] 错误 2
在正常步骤下,除了安装ncurses,还要安装build-essential 和 kernel-package
首先,查询kernel-package信息
#apt-cache show kernel-package
Package:kernel-package
Priority:optional
Section:universe/misc
Installed-Size:1806
Maintainer:Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
Original-Maintainer:Manoj Srivastava <srivasta@debian.org>
Architecture:all
Version:12.036+nmu2
Depends:build-essential, make (>= 3.80-10), po-debconf, gettext, file, debianutils(>= 2.30), binutils (>= 2.12), util-linux (>= 2.10o),module-init-tools (>= 0.9.10)
Recommends:cpio
Suggests:linux-source | kernel-source, e2fsprogs (>= 1.41.4), libncurses-dev,docbook-utils, xmlto, bzip2, linux-initramfs-tool, grub (>= 0.93) | grub2,jfsutils (>= 1.1.3), mcelog (>= 0.6), oprofile (>= 0.9), pcmciautils(>= 004), ppp (>= 2.4.0), procps (>= 3.2.0), reiserfsprogs (>=3.6.3), squashfs-tools (>= 4.0), udev (>= 081), xfsprogs (>= 2.6.0),quota, btrfs-tools
Filename:pool/universe/k/kernel-package/kernel-package_12.036+nmu2_all.deb
Size:399694
MD5sum:0168c3dc45aadc08bdfbb96e98a8e6fa
SHA1:3451296ca4b502746152378bb4e9e0560ee2c79c
SHA256:30650206e074e918b27e856a32bfed41e6b0b76e9104bedb45c205e3a4996d6f
Description-en:A utility for building Linux kernel related Debian packages.
This package provides the capability to createa Debian kernel image
package by just running make-kpkg kernel_imagein a kernel source
directory tree. It can also package the relevant kernelheaders into
a kernel-headers package. In general, thispackage is very useful if
you need to create a custom kernel, if, forexample, the default
kernel does not support some of your hardware,or you wish a leaner,
meaner kernel. It also scripts the steps that need be taken to
compile the kernel, which is quite convenient(forgetting a crucial
step once was the initial motivation for thispackage). Please look at
/usr/share/doc/kernel-package/Rationale.gz fora full list of advantages
of this package.
Description-md5:45bea2a67b3b2cf92611d53927d2676e
Bugs:https://bugs.launchpad.net/ubuntu/+filebug
Origin:Ubuntu
查询一下kernel-package安装设置状态,
#apt-cache policy kernel-package
kernel-package:
已安装: (无)
候选软件包:12.036+nmu2
版本列表:
12.036+nmu2 0
500http://cn.archive.ubuntu.com/ubuntu/ precise/universe amd64 Packages
所以需要安装kernel-package:
# apt-get install kernel-package
正在读取软件包列表...完成
正在分析软件包的依赖关系树
正在读取状态信息... 完成
下列软件包是自动安装的并且现在不需要了:
zerofree gir1.2-ubuntuoneui-3.0 libdumbnet1dkms libubuntuoneui-3.0-1
thunderbird-globalmenu
使用'apt-getautoremove'来卸载它们
将会安装下列额外的软件包:
gettext intltool-debian libgettextpo0libmail-sendmail-perl libsys-hostname-long-perl
libunistring0 po-debconf
建议安装的软件包:
gettext-doc linux-source kernel-sourcedocbook-utils xmlto grub grub2 jfsutils mcelog
oprofile reiserfsprogs squashfs-toolsxfsprogs quota btrfs-tools libmail-box-perl
下列【新】软件包将被安装:
gettext intltool-debian kernel-packagelibgettextpo0 libmail-sendmail-perl
libsys-hostname-long-perl libunistring0po-debconf
升级了 0 个软件包,新安装了 8 个软件包,要卸载 0 个软件包,有59 个软件包未被升级。
需要下载 2,414kB 的软件包。
解压缩后会消耗掉8,393 kB 的额外空间。
您希望继续执行吗?[Y/n]y
…
ldconfigdeferred processing now taking place
接下来查看build-essential,
#apt-cache policy build-essential
build-essential:
已安装: 11.5ubuntu2.1
候选软件包:11.5ubuntu2.1
版本列表:
*** 11.5ubuntu2.1 0
500http://cn.archive.ubuntu.com/ubuntu/ precise-updates/main amd64 Packages
100 /var/lib/dpkg/status
11.5ubuntu2 0
500http://cn.archive.ubuntu.com/ubuntu/ precise/main amd64 Packages
接着安装QT3库, libqt3-headers相关信息:
http://www.examplenow.com/zh-cn/package/libqt3-headers/
apt-getinstall libqt3-headers libqt3-mt-dev
然后make xconfig就可以正常化打开下面的界面:
图1
接着apt-get install libqt3-compat-headers,具体为什么还要安装这个,以后再弄明白
到此,执行make xconfig,即可
我们通过Make menuconfig也来看看menuconfig界面:
HOSTCC scripts/kconfig/lxdialog/checklist.o
HOSTCC scripts/kconfig/lxdialog/inputbox.o
HOSTCC scripts/kconfig/lxdialog/menubox.o
HOSTCC scripts/kconfig/lxdialog/textbox.o
scripts/kconfig/lxdialog/textbox.c:在函数‘print_line’中:
scripts/kconfig/lxdialog/textbox.c:323:9:警告: 变量‘x’被设定但未被使用 [-Wunused-but-set-variable]
scripts/kconfig/lxdialog/textbox.c:323:6:警告: 变量‘y’被设定但未被使用 [-Wunused-but-set-variable]
HOSTCC scripts/kconfig/lxdialog/util.o
HOSTCC scripts/kconfig/lxdialog/yesno.o
HOSTCC scripts/kconfig/mconf.o
HOSTLD scripts/kconfig/mconf
scripts/kconfig/mconfarch/arm/Kconfig
***End of Linux kernel configuration.
***Execute 'make' to build the kernel or try 'make help'.
弹出下面的对话框:
图2
如果出错,需要sudo apt-get insatll ncurses-dev
对比xconfig和menuconfig的界面,可见xconfig的使用更为 方便。
参考链接: