您的位置:首页 > 运维架构 > Linux

CentOS5.5编译安装gvim7.3 失败记录

2012-08-06 10:30 477 查看
现在Vim的最新版本是v7.3,而CentOS最新只能更新到v7.2,所以想自己编译安装一下试试,顺便安装gvim,不过最后gvim还是安装失败了。不知道为什么,先记录一下,后面再摸索摸索吧:

1、下载vim源代码
vim的官方网站是:www.vmunix.com/vim
可以用这个链接下载源码包:ftp://ftp.jp.vim.org/pub/vim/unix/vim-7.0.tar.bz2

[b]2、解压

[/b]将 /usr/src/vim-7.3.tar.bz2 文件解压缩在 /usr/local 底下

cd /usr/local
tar -xvf  /usr/src/vim-7.3.tar.bz2


3、配置

./configure --prefix=/usr/local/vim73 --with-x --enable-gui=gtk2  --with-features=big --disable-selinux --enable-multibyte


这里如果没有“--disable selinux”configure的时候会报错:

os_unix.c:45:30: 错误:selinux/selinux.h:没有那个文件或目录

os_unix.c: In function ‘mch_copy_sec’:

os_unix.c:2667: 警告:隐式声明函数 ‘is_selinux_enabled’

os_unix.c:2671: 错误:‘security_context_t’ 未声明 (在此函数内第一次使用)

os_unix.c:2671: 错误:(即使在一个函数内多次出现,每个未声明的标识符在其

os_unix.c:2671: 错误:所在的函数内只报告一次。)

os_unix.c:2671: 错误:expected ‘;’ before ‘from_context’

os_unix.c:2672: 错误:expected ‘;’ before ‘to_context’

os_unix.c:2674: 警告:隐式声明函数 ‘getfilecon’

os_unix.c:2674: 错误:‘from_context’ 未声明 (在此函数内第一次使用)

os_unix.c:2687: 错误:‘to_context’ 未声明 (在此函数内第一次使用)

os_unix.c:2692: 警告:隐式声明函数 ‘freecon’

os_unix.c:2697: 警告:隐式声明函数 ‘setfilecon’

make[2]: *** [objects/os_unix.o] 错误 1

make[2]: Leaving directory `/opt/bzip2/vim73/src'

make[1]: *** [myself] 错误 2

make[1]: Leaving directory `/opt/bzip2/vim73/src'

make: *** [first] 错误 2

如果没有安装ncurses这个库,configure的时候还是会报错:

checking --with-tlib argument... empty: automatic terminal library selection
checking for tgetent in -lncurses... no

checking for tgetent in -ltermlib... no

checking for tgetent in -ltermcap... no

checking for tgetent in -lcurses... no

no terminal library found

checking for tgetent()... configure: error: NOT FOUND!

You need to install a terminal library; for example ncurses.

Or specify the name of the library with --with-tlib.

安装ncurses

yum  install  ncurses-devel


安装ncurses后重新configure:

/configure --prefix=/usr/local/vim73 --with-x --enable-gui=gtk2  --with-features=big --disable-selinux --enable-multibyte


4、make/make install

接下来执行: make && make install 。现在你的Vim7.3就在 /usr/local/了 O(∩_∩)O~

5、建立链接

mv /usr/bin/vim /usr/bin/vim_backup           # 先将原来的备份
ln -s /usr/local/vim73/bin/vim /usr/bin/vim   # 再将vim 7.3链接过来


6、运行

当运行vim的时候,显示已经升级到最新版的7.3了



但是在执行gvim命令的时候,提示:

[root@localhost ~]# gvim
bash: /usr/bin/gvim: 没有那个文件或目录


是不是没有建立链接,

ln -s /usr/local/vim73/bin/gvim /usr/bin/gvim 还是不行

到/usr/local/vim73/bin/一看,根本没有gvim,真是不明白为什么。我的配置过程中明明加了--enable-gui=gtk2,过程中似乎没有什么提示啊。敬请高手指点!

最后还是装了老的版本:
yum install vim-X11


内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: