linking gvim on the mac

605 views
Skip to first unread message

Charles Campbell

unread,
May 29, 2014, 2:01:52 PM5/29/14
to vim...@googlegroups.com
Hello!

I'm able to compile vim on the mac -- but not gvim.

I suspect its due to missing libraries. As is, when I try vim -g

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

* how can I know what libraries I need to get onto the mac to get a
gvim? I need to know ahead of time because I don't have admin
privileges on the machine, and so need to tell the admin what to do.
* if its not simply libraries, what configuration do I need? To start
with, I've been trying configure --with-features=huge --enable-gui=yes

When I compile this way, I get an error message:

./os_mac.h:31:11: fatal error: 'Quickdraw.h' file not found

Hope you can help,
Chip Campbell


Kazunobu Kuriyama

unread,
May 30, 2014, 5:41:50 AM5/30/14
to vim...@googlegroups.com
On May 30, 2014, at 3:01, Charles Campbell <Charles.E...@nasa.gov> wrote:

> Hello!
>
> I'm able to compile vim on the mac -- but not gvim.
>
> I suspect its due to missing libraries. As is, when I try vim -g
>
> E25: GUI cannot be used; Not enabled at compile time
>
> * how can I know what libraries I need to get onto the mac to get a gvim? I need to know ahead of time because I don't have admin privileges on the machine, and so need to tell the admin what to do.
> * if its not simply libraries, what configuration do I need? To start with, I've been trying configure --with-features=huge --enable-gui=yes

Can you try to add —disable-darwin to the options above and build vim with the resulting Makefile?

That way, if XQuartz.app (X11.app) has been installed normally on the Mac, the configure script should automatically detect X11 and GUI toolkits on the Mac and build gvim, at least the one which is linked to the legacy Athena library.

Actually, I can build gvim with Athena, Motif, gtk+-2 that way. FYI, Motif and gtk+2 library were installed through MacPorts.

Good luck,
Kazunobu Kuriyama

>
> When I compile this way, I get an error message:
>
> ./os_mac.h:31:11: fatal error: 'Quickdraw.h' file not found
>
> Hope you can help,
> Chip Campbell
>
>
> --
> --
> You received this message from the "vim_mac" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php
>
> --- You received this message because you are subscribed to the Google Groups "vim_mac" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to vim_mac+u...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Charles Campbell

unread,
May 30, 2014, 10:50:11 AM5/30/14
to vim...@googlegroups.com
Kazunobu Kuriyama wrote:
> On May 30, 2014, at 3:01, Charles Campbell <Charles.E...@nasa.gov> wrote:
>
>> Hello!
>>
>> I'm able to compile vim on the mac -- but not gvim.
>>
>> I suspect its due to missing libraries. As is, when I try vim -g
>>
>> E25: GUI cannot be used; Not enabled at compile time
>>
>> * how can I know what libraries I need to get onto the mac to get a gvim? I need to know ahead of time because I don't have admin privileges on the machine, and so need to tell the admin what to do.
>> * if its not simply libraries, what configuration do I need? To start with, I've been trying configure --with-features=huge --enable-gui=yes
> Can you try to add --disable-darwin to the options above and build vim with the resulting Makefile?
>
> That way, if XQuartz.app (X11.app) has been installed normally on the Mac, the configure script should automatically detect X11 and GUI toolkits on the Mac and build gvim, at least the one which is linked to the legacy Athena library.
>
> Actually, I can build gvim with Athena, Motif, gtk+-2 that way. FYI, Motif and gtk+2 library were installed through MacPorts.
>
Thank you for the help!

Vim now compiles and links successfully. However, a new problem
appears: it issues a number of warnings and then crashes. Looks like an
"X" problem:

Used: vim -g -u NONE -N

Warning:
Name: subMenu
Class: XmCascadeButton
Illegal mnemonic character: Could not convert X KEYSYM to a keycode
...
dyld: lazy symbol binding failed: Symbol not found: _XftDrawCreate
Referenced from: /usr/local/lib/libXm.4.dylib
Expected in: flat namespace
...
Vim: Caught deadly signal TRAP
Vim: Finished.
Trace/BPT trap

Regards,
Chip Campbell

Bee

unread,
May 30, 2014, 5:45:36 PM5/30/14
to vim...@googlegroups.com
I use the 'Download ZIP' button from:
https://github.com/b4winckler/macvim/

It compiles on my MacOSs 10.4.11 to 10.6.8

Then move the MacVim.app to /Applications/MacVim/

And add this to my .profile:

MACVIM="/Applications/MacVim/MacVim.app/Contents/MacOS";
if [ -e "$MACVIM" ]; then
alias vim="$MACVIM/Vim ${@}";
alias gvim="$MACVIM/Vim -g ${@}";
fi; export EDITOR=vim; alias e=vim;

Kazunobu Kuriyama

unread,
May 31, 2014, 4:20:26 AM5/31/14
to vim...@googlegroups.com
On May 30, 2014, at 23:50, Charles Campbell <Charles.E...@nasa.gov> wrote:

> Kazunobu Kuriyama wrote:
>> On May 30, 2014, at 3:01, Charles Campbell <Charles.E...@nasa.gov> wrote:
>>
>>> Hello!
>>>
>>> I'm able to compile vim on the mac -- but not gvim.
>>>
>>> I suspect its due to missing libraries. As is, when I try vim -g
>>>
>>> E25: GUI cannot be used; Not enabled at compile time
>>>
>>> * how can I know what libraries I need to get onto the mac to get a gvim? I need to know ahead of time because I don't have admin privileges on the machine, and so need to tell the admin what to do.
>>> * if its not simply libraries, what configuration do I need? To start with, I've been trying configure --with-features=huge --enable-gui=yes
>> Can you try to add --disable-darwin to the options above and build vim with the resulting Makefile?
>>
>> That way, if XQuartz.app (X11.app) has been installed normally on the Mac, the configure script should automatically detect X11 and GUI toolkits on the Mac and build gvim, at least the one which is linked to the legacy Athena library.
>>
>> Actually, I can build gvim with Athena, Motif, gtk+-2 that way. FYI, Motif and gtk+2 library were installed through MacPorts.
>>
> Thank you for the help!
>
> Vim now compiles and links successfully. However, a new problem appears: it issues a number of warnings and then crashes. Looks like an "X" problem:
>
> Used: vim -g -u NONE -N
>
> Warning:
> Name: subMenu
> Class: XmCascadeButton
> Illegal mnemonic character: Could not convert X KEYSYM to a keycode
> …

I also get these warnings at gvim’s startup. It’s really annoying, and, as the warnings indicate, some of the mnemonics are insensible and the shortcuts are seemingly all ignored. I’m not sure which is responsible for that, Vim or Motif. But the menu system itself works fine if it is activated through mouse button clicking.

> dyld: lazy symbol binding failed: Symbol not found: _XftDrawCreate
> Referenced from: /usr/local/lib/libXm.4.dylib
> Expected in: flat namespace
> ...
> Vim: Caught deadly signal TRAP
> Vim: Finished.
> Trace/BPT trap

Since Vim doesn’t refer to any symbol of the Xft library directly, I think the cause of the problem is due to the Motif on your computer.

As a first step for fix, do

$ otool -L /path/to/libXm.dylib

on a terminal and check if the path to libXft.?.dylib is exactly the place at which Xft is installed on the computer. If there’re contradictions between the paths, the cause of the problem is tracked back to the configure/make process of the Motif.

(I’m assuming you desperately need to use Motif. Otherwise, I’d like to recommend fully functional gtk2-gvim.)

Regards,
Kazunobu Kuriyama

>
> Regards,

Charles Campbell

unread,
Jun 3, 2014, 3:16:53 PM6/3/14
to vim...@googlegroups.com
Kazunobu Kuriyama wrote:
> On May 30, 2014, at 23:50, Charles Campbell <Charles.E...@nasa.gov> wrote:
>
>> Kazunobu Kuriyama wrote:
>>> On May 30, 2014, at 3:01, Charles Campbell <Charles.E...@nasa.gov> wrote:
>>>
>>>> Hello!
>>>>
>>>> I'm able to compile vim on the mac -- but not gvim.
>>>>
>>>> I suspect its due to missing libraries. As is, when I try vim -g
>>>>
>>>> E25: GUI cannot be used; Not enabled at compile time
>>>>
>>>> * how can I know what libraries I need to get onto the mac to get a gvim? I need to know ahead of time because I don't have admin privileges on the machine, and so need to tell the admin what to do.
>>>> * if its not simply libraries, what configuration do I need? To start with, I've been trying configure --with-features=huge --enable-gui=yes
>>> Can you try to add --disable-darwin to the options above and build vim with the resulting Makefile?
>>>
>>> That way, if XQuartz.app (X11.app) has been installed normally on the Mac, the configure script should automatically detect X11 and GUI toolkits on the Mac and build gvim, at least the one which is linked to the legacy Athena library.
>>>
>>> Actually, I can build gvim with Athena, Motif, gtk+-2 that way. FYI, Motif and gtk+2 library were installed through MacPorts.
>>>
>> Thank you for the help!
>>
>> Vim now compiles and links successfully. However, a new problem appears: it issues a number of warnings and then crashes. Looks like an "X" problem:
>>
>> Used: vim -g -u NONE -N
>>
>> Warning:
>> Name: subMenu
>> Class: XmCascadeButton
>> Illegal mnemonic character: Could not convert X KEYSYM to a keycode
>> ...
> I also get these warnings at gvim's startup. It's really annoying, and, as the warnings indicate, some of the mnemonics are insensible and the shortcuts are seemingly all ignored. I'm not sure which is responsible for that, Vim or Motif. But the menu system itself works fine if it is activated through mouse button clicking.
>
>> dyld: lazy symbol binding failed: Symbol not found: _XftDrawCreate
>> Referenced from: /usr/local/lib/libXm.4.dylib
>> Expected in: flat namespace
>> ...
>> Vim: Caught deadly signal TRAP
>> Vim: Finished.
>> Trace/BPT trap
> Since Vim doesn't refer to any symbol of the Xft library directly, I think the cause of the problem is due to the Motif on your computer.
>
> As a first step for fix, do
>
> $ otool -L /path/to/libXm.dylib
>
> on a terminal and check if the path to libXft.?.dylib is exactly the place at which Xft is installed on the computer. If there're contradictions between the paths, the cause of the problem is tracked back to the configure/make process of the Motif.
>
> (I'm assuming you desperately need to use Motif. Otherwise, I'd like to recommend fully functional gtk2-gvim.)
>
Hello!

I'd *much* rather have gtk than motif. However, when I run configure
--with-gtk2 I see no problems in the configure output -- but vim insists
on not having gui enabled. Presumably I'm missing some library or
something. It does compile, just with no gui. So, how do I get that
fully functional gtk2-gvim to compile on a Mac?
A better way to ask that: what can I do to enable you to help me figure
out what's missing?

Regards,
Chip Campbell
Reply all
Reply to author
Forward
0 new messages