Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I'm trying to compile the latest version of vim (7.3.785 as on date) with the --enable-gui option set to yes:

./configure --enable-gui=yes
make

but make fails with several errors (full output). I can't quite make sense of the errors, as I don't see anything specific that I can fix. I must add that compiling it works fine without the GUI option, so it might be something directly related to X or the OS X Cocoa frame work. I'm running OS X 10.8.2 on a retina MBP.

What should I change/add/install to get this to work?

Note: This question is explicitly about compiling vim from source with the GUI option. I'm aware of macvim and this is what I use for almost everything. However, in order to embed vim inside Eclipse using eclim, I need gvim (works out of the box on Windows and Linux). Unfortunately, macvim does not support embedding inside Eclipse, hence my attempts to make it work on OS X.

share|improve this question
    
Did you try Homebrew? It would be very simple to edit the formula for vim (brew edit vim) and change the line --enable-gui=no to --enable-gui=yes. Your log suggests you might be missing some dependencies. –  Dominique Jan 30 '13 at 13:05
add comment

1 Answer

up vote 1 down vote accepted

You can fix the error about missing header files by exporting CFLAGS like this before running make:

export CFLAGS="-I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/Developer/Headers/FlatCarbon/"

Unfortunately, a new attempt to compile vim fails with loads of errors:

/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/Headers/MacTypes.h:17:24: error: #include nested too deeply
(...)
/System/Library/Frameworks/CoreFoundation.framework/Headers/CFBase.h:156: error: conflicting types for ‘Boolean’
/usr/X11/include/X11/Intrinsic.h:155: error: previous declaration of ‘Boolean’ was here
(...)
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/Headers/MacTypes.h:11:20: error: missing binary operator before token "("
(...)

and README_mac.txt doesn't offer much help:

(...)
Sorry, this text still needs to be written!

After some more failed attempts with other compile options, and after skimming through the errors, one quickly gets the impression that GUI support is not yet implemented for OS X, at least for Quartz.

A look to the other options for getting vim, HomeBrew and MacPorts, pretty much confirms the suspicion: The former doesn't offer GUI support at all (see here) and the latter only using X11 (see here).

So to compile vim with GUI support you will have to revert to the good ol' X11 (I tested the Athena widgets, other options are motif and, if you use GTK, gtk1 and gtk2):

$ make distclean
$ ./configure --enable-gui=yes --enable-gui=athena --disable-darwin

After launching XQuartz I could start vim in GUI mode:

$ export DISPLAY=:0
$ ./src/vim -g

enter image description here

However, I have the impression that this is not the GUI support you need to embed vim inside Eclipse.

share|improve this answer
    
Although it doesn't work with Eclipse, this answers my question, so +1! Eclipse needs vim with gtk support, but I seem to be having issues compiling that as well. However, that's a different issue and looks like I might be able to fix it myself. Thanks :) –  rm -rf Jan 30 '13 at 17:13
    
Thanks, I'm glad I could help, hopefully you can get vim to compile with GKT support. –  jaume Jan 30 '13 at 17:21
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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