I have two HP-UX machines say A and B with HP-UX 11.11 and 11.31 respectively. I have compiled gvim 7.3 from source an B, and gvim 7.0 on A.

On A, gvim uses "version with GTK GUI", Compilation with gcc (...) -DFEAT_GUI_GTK and all works fine.

On B, gvim looks different and uses "version with X11-Motif GUI". Here ssh -X does not copy paste on selection exactly as in the thread "GVim compiled from source opened via SSH -X does not copy paste on selection":

  • copy/paste via select works on a GVim window on A, but not on B.
  • When I select some text in the GVim window, I can paste it via right-click within that window, but I cannot paste it into anything running locally. When I select something locally, I can paste it locally but when I paste into the GVim window, it pastes the last thing selected in the GVim window, not the last thing selected locally.

The Problem is: I cannot rebuild gvim with gtk. Although I have installed GTK+ on the machine via HP depot (GTK 2.6) and using gtk+ is called default in the Makefile configure ends up with compiler option "gcc (...) -DFEAT_GUI_MOTIF".

to be more specific: configure gives:

checking --enable-gui argument... yes/auto - automatic GUI support
checking whether or not to look for GTK+ 2... yes

but doesn't search for gtk Libraries. It only looks for Motif:

checking for location of Motif GUI libs... /usr/lib/Motif1.1

It doesn't tell me that it is missing anything I can provide! In the directory "auto" the file configure.log shows no failure in searching for GTk, it just doesn't look for!

configure:7577: result: yes/auto - automatic GUI support
configure:7609: checking whether or not to look for GTK+ 2
configure:7618: result: yes
configure:7627: checking whether or not to look for GNOME
configure:7636: result: no
configure:7644: checking whether or not to look for Motif
configure:7653: result: yes
configure:7661: checking whether or not to look for Athena
configure:7670: result: yes
configure:7678: checking whether or not to look for neXtaw
configure:7687: result: yes
configure:7695: checking whether or not to look for Carbon
configure:7704: result: yes
configure:7752: checking --disable-gtktest argument
configure:7762: result: gtk test enabled
configure:7772: checking for pkg-config
configure:7803: result: no
configure:8035: checking for location of Motif GUI includes
configure:8047: result: in default path
configure:8062: checking --with-motif-lib argument
configure:8076: result: no
configure:8081: checking for location of Motif GUI libs
configure:8099: result: /usr/lib/Motif1.1
configure:8202: checking for XShapeQueryExtension in -lXext

And make starts with OPTION Motif:

avalenti@ncc1n:/usr/local/src/vim/vim73/src >make | tee make-minimal.results
mkdir objects
CC="gcc -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_MOTIF   -I/usr/local/include      " srcdir=. sh ./osdef.sh
gcc -c -I. -Iproto -DHAVE_CONFIG_H -DFEAT_GUI_MOTIF   -I/usr/local/include  -g -O2 -D_FORTIFY_SOURCE=1       -o objects/buffer.o buffer.c

If I force usings gtk with

configure --enable-gui=gtk2 

make ends up with no error but gvim says:

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

How can I force gvim to compile using gtk2?


Did you install the GTK2 '-dev' packages? They're the 'other half'. Most people usually just need the libraries, since the programs are already written and compiled, they just link to the libraries and life is good.

But people compiling code need the 'descriptions and pointers' to the library routines, which is contained in the '-dev' packages. I write it that way since the package names are usually very similar, only with '-dev' tacked on the end.

For example, on my system, the '-dev' file for GTK2 is named 'libgtk2.0-dev'. Have a look in your package manager for something similar.

Good Luck.

You don't get an error since the Vim configure script doesn't REQUIRE the GTK2 libraries, it's an 'auto' configure option, so if it exists, it uses it, if not, it falls back to the visually stunning motif look.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.