11

I'm having a hard time building a VIM 7.4(obtained from vim's ftp site) with gui option. It builds ok without the gui
option. Here's how I'm doing it:

cd ~/Downloads/vim74/src
./configure --enable-gui

The above line does not seem to work because I get this output from the command:

./configure --enable-gui | grep gui
checking --enable-gui argument... no GUI support

I uncommented line 352 of the makefile to enable the gui(I think):

CONF_OPT_GUI = --enable-gui=gtk2

But when I run vim -g(after rebuilding) I get:

E25: GUI cannot be used: Not enabled at compile time

There's a suggestion in the makefile to check the generated auto/config.h and
auto/config.mk files but the files are empty(less than 10 lines).
How do you fix this?

Plakhoy
  • 252

3 Answers3

8

To build Vim you will need first to install all the dependencies. This could be done using

$ sudo apt-get build-dep vim-gtk # or vim-gnome, if you prefer.

This will download and install a lot of packages that should only be needed to compile Vim. If you don't want to keep them, before running that command add this to /etc/apt/apt.conf

APT {
  Get {
     Build-Dep-Automatic "true";
  };
};

This will make all the packages installed with build-dep be "marked to be autoremoved". So after you finished compiling Vim you can uninstall them using sudo apt-get autoremove.

After this, just proceed with the usual steps:

$ ./configure --with-gui=gtk2 # or gnome
$ make -j 4
$ sudo make install  
Salem
  • 19,864
  • 6
  • 65
  • 90
3

If you call ./configure --enable-gui=auto, the build process will automatically build against whichever GUI libraries are available. A cursory glance suggests that gtk2 will be prioritised over gnome2.

Tullo_x86
  • 131
1

Just run into the same issue on Ubuntu 16.04. Turns out, it happens because packages with headers/libs for GTK2/Gnome aren't installed. After sudo apt-get install gnome-devel as @RAOF advised in this post, vim --version says it has GUI GTK2 support and gvim, gvimdiff, gview symlinks are created during install.

kenorb
  • 10,944