Can't compile latest Vim using Make_cyg.mak

142 views
Skip to first unread message

Christian J. Robinson

unread,
Nov 15, 2012, 2:25:23 AM11/15/12
to bu...@vim.org, vim...@googlegroups.com

gcc-3 -O3 -fomit-frame-pointer -freg-struct-return -fno-strength-reduce -DWIN32 -DHAVE_PATHDEF -DFEAT_BIG -DWINVER=0x0500 -D_WIN32_WINNT=0x0500 -DFEAT_PERL -DDYNAMIC_PERL -DDYNAMIC_PERL_DLL=\"perl512.dll\" -DFEAT_PYTHON -DDYNAMIC_PYTHON -DDYNAMIC_PYTHON_DLL=\"python27.dll\" -DFEAT_RUBY -DDYNAMIC_RUBY -DDYNAMIC_RUBY_DLL=\"msvcrt-ruby191.dll\" -DDYNAMIC_RUBY_VER=191 -DDYNAMIC_GETTEXT -DDYNAMIC_ICONV -DFEAT_MBYTE -DFEAT_MBYTE_IME -DDYNAMIC_IME -DMSWINPS -DFEAT_CSCOPE -DFEAT_NETBEANS_INTG -DFEAT_XPM_W32 -DFEAT_GUI_W32 -DFEAT_CLIPBOARD -DFEAT_OLE -march=i386 -Iproto -I/cygdrive/c/strawberry/perl/lib/CORE -I/cygdrive/c/Ruby192/include/ruby-1.9.1 -I/cygdrive/c/Ruby192/include/ruby-1.9.1/i386-mingw32 -s -mno-cygwin -Ixpm/include -o gvim.exe gobj/blowfish.o gobj/buffer.o gobj/charset.o gobj/diff.o gobj/digraph.o gobj/edit.o gobj/eval.o gobj/ex_cmds.o gobj/ex_cmds2.o gobj/ex_docmd.o gobj/ex_eval.o gobj/ex_getln.o gobj/fileio.o gobj/fold.o gobj/getchar.o gobj/hardcopy.o gobj/hashtab.o gobj/main.o gobj/mark.o gobj/memfile.o gobj/memline.o gobj/menu.o gobj/message.o gobj/misc1.o gobj/misc2.o gobj/move.o gobj/mbyte.o gobj/normal.o gobj/ops.o gobj/option.o gobj/os_win32.o gobj/os_mswin.o gobj/pathdef.o gobj/popupmnu.o gobj/quickfix.o gobj/regexp.o gobj/screen.o gobj/search.o gobj/sha256.o gobj/spell.o gobj/syntax.o gobj/tag.o gobj/term.o gobj/ui.o gobj/undo.o gobj/version.o gobj/vimrc.o gobj/window.o gobj/if_perl.o gobj/if_python.o gobj/if_ruby.o gobj/if_cscope.o gobj/netbeans.o gobj/xpm_w32.o gobj/gui.o gobj/gui_w32.o gobj/gui_beval.o gobj/os_w32exe.o gobj/if_ole.o -L/lib/w32api -L/usr/lib/mingw -L/usr/lib/w32api -I/usr/include/mingw -I/usr/include/w32api -luuid -lole32 -lwsock32 -Lxpm/lib -Lxpm/x86/lib -lXpm -L/lib/w32api -mwindows -lcomctl32 -lversion -loleaut32 -lstdc++
gobj/eval.o:eval.c:(.text+0x70b7): undefined reference to `_pow'
collect2: ld returned 1 exit status
Make_cyg.mak:534: recipe for target `gvim.exe' failed
make: *** [gvim.exe] Error 1

--
Having a non-smoking section in a restaurant
is like having a non-peeing section in a pool.
Christian J. Robinson <hep...@gmail.com> http://christianrobinson.name/

skeept

unread,
Nov 15, 2012, 3:10:38 AM11/15/12
to vim...@googlegroups.com, bu...@vim.org
I can't understand why it doesn't work. I can compile vim in cygwin in 32 bits, but don't know how to do it in 64 bits.
I have to change the name of the compiler tough.
See
https://groups.google.com/d/msg/vim_use/80X4edvhEeo/u7oYDye-5oYJ
for what I usually when compiling vim in cygwin.

Regards,
Jorge

Christian J. Robinson

unread,
Nov 15, 2012, 4:07:41 PM11/15/12
to Bram Moolenaar, vim...@googlegroups.com
On Thu, 15 Nov 2012, Bram Moolenaar wrote:

>> gobj/eval.o:eval.c:(.text+0x70b7): undefined reference to `_pow'
>> collect2: ld returned 1 exit status
>> Make_cyg.mak:534: recipe for target `gvim.exe' failed
>> make: *** [gvim.exe] Error 1
>
> Please send a message to the vim-dev maillist. It's probably
> something in your setup. At least the call to pow() has not changed
> for quite a while.

The original message was also sent to vim-dev. I have confirmed that
/something/ in my cygwin setup has changed, but I have no idea what. I
was able to compile patchlevel 712 on October 24th, but when I backed
my local repository out to the same patchlevel this morning it now
fails to compile even 712, with the same error shown above.

I would like to note that I have /never/ been able to get
Make_ming.mak to work under Cygwin, although other people appear to
know the "magic incantations." If someone could give me a hint,
perhaps it would work where Make_cyg.mak now fails.

- Christian

--
"They misunderestimated me."
-- George W. Bush, Bentonville, Ark., Nov. 6, 2000

Christian J. Robinson

unread,
Nov 20, 2012, 4:53:55 PM11/20/12
to vim...@googlegroups.com
On Thu, 15 Nov 2012, Christian J. Robinson wrote:

> I would like to note that I have /never/ been able to get
> Make_ming.mak to work under Cygwin, although other people appear to
> know the "magic incantations." If someone could give me a hint,
> perhaps it would work where Make_cyg.mak now fails.

I was able to get Make_ming.mak to compile a native Windows gvim.exe
using Cygwin's MinGW packages as long as I don't try to include Ruby.

When I try to include Ruby I get the following errors:

i686-w64-mingw32-gcc -c -Iproto -DWIN32 -DWINVER=0x0500 -D_WIN32_WINNT=0x0500 -DHAVE_PATHDEF -DFEAT_BIG -DHAVE_GETTEXT -DHAVE_LOCALE_H -DDYNAMIC_GETTEXT -DMSWINPS -DFEAT_OLE -DFEAT_CSCOPE -DFEAT_NETBEANS_INTG -DFEAT_GUI_W32 -DFEAT_CLIPBOARD -DFEAT_MBYTE -DFEAT_MBYTE_IME -DDYNAMIC_IME -DDYNAMIC_ICONV -pipe -w -march=i386 -Wall -I/cygdrive/c/strawberry/perl/lib/Core -DFEAT_PERL -L/cygdrive/c/strawberry/perl/lib/Core -DDYNAMIC_PERL -DDYNAMIC_PERL_DLL=\"perl56.dll\" -DFEAT_RUBY -I /cygdrive/c/Ruby192/lib/ruby/1.9.1/i386-mingw32 -I /cygdrive/c/Ruby192/include/ruby-1.9.1 -I /cygdrive/c/Ruby192/include/ruby-1.9.1/i386-mingw32 -DDYNAMIC_RUBY -DDYNAMIC_RUBY_DLL=\"msvcrt-ruby191.dll\" -DDYNAMIC_RUBY_VER=191 -DFEAT_PYTHON -DDYNAMIC_PYTHON -DFEAT_XPM_W32 -I xpm/x86/include -I xpm/x86/../include -O3 -fomit-frame-pointer -freg-struct-return -s if_ruby.c -o gobji386/if_ruby.o
In file included from /cygdrive/c/Ruby192/include/ruby-1.9.1/ruby/defines.h:205:0,
from /cygdrive/c/Ruby192/include/ruby-1.9.1/ruby/ruby.h:74,
from /cygdrive/c/Ruby192/include/ruby-1.9.1/ruby.h:32,
from if_ruby.c:88:
/cygdrive/c/Ruby192/include/ruby-1.9.1/ruby/win32.h:376:18: error: conflicting types for οΏ½fseekoοΏ½
/usr/i686-w64-mingw32/sys-root/mingw/include/stdio.h:473:7: note: previous declaration of οΏ½fseekoοΏ½ was here
/cygdrive/c/Ruby192/include/ruby-1.9.1/ruby/win32.h:377:18: error: conflicting types for οΏ½ftelloοΏ½
/usr/i686-w64-mingw32/sys-root/mingw/include/stdio.h:484:10: note: previous declaration of οΏ½ftelloοΏ½ was here
In file included from /cygdrive/c/Ruby192/include/ruby-1.9.1/ruby/ruby.h:1326:0,
from /cygdrive/c/Ruby192/include/ruby-1.9.1/ruby.h:32,
from if_ruby.c:88:
/cygdrive/c/Ruby192/include/ruby-1.9.1/ruby/missing.h:35:8: error: redefinition of οΏ½struct timespecοΏ½
/usr/i686-w64-mingw32/sys-root/mingw/include/sys/types.h:89:8: note: originally defined here
/cygdrive/c/Ruby192/include/ruby-1.9.1/ruby/missing.h:42:8: error: redefinition of οΏ½struct timezoneοΏ½
/usr/i686-w64-mingw32/sys-root/mingw/include/time.h:260:8: note: originally defined here
if_ruby.c:339:21: error: static declaration of οΏ½rb_num2long_stubοΏ½ follows non-static declaration
/cygdrive/c/Ruby192/include/ruby-1.9.1/ruby/ruby.h:478:14: note: previous declaration of οΏ½rb_num2long_stubοΏ½ was here
if_ruby.c:343:14: error: static declaration of οΏ½rb_int2big_stubοΏ½ follows non-static declaration
/cygdrive/c/Ruby192/include/ruby-1.9.1/ruby/intern.h:85:7: note: previous declaration of οΏ½rb_int2big_stubοΏ½ was here
Make_ming.mak:715: recipe for target `gobji386/if_ruby.o' failed
make: *** [gobji386/if_ruby.o] Error 1


I wonder if this would be a problem if I used a non-Cygwin MinGW
distribution, but this has become too much trouble already. Hopefully
someone can suggest a fix, or I'll just live without the Ruby
interpreter. (+perl/dyn and +python/dyn were included without issue.)

- Christian

--
"Once," adverb: Enough.

Steve Hall

unread,
Nov 20, 2012, 7:50:53 PM11/20/12
to vim...@googlegroups.com
On Tue, Nov 20, 2012 at 4:53 PM, Christian J. Robinson
<hep...@gmail.com> wrote:
>
> I was able to get Make_ming.mak to compile a native Windows gvim.exe
> using Cygwin's MinGW packages as long as I don't try to include
> Ruby.
>
> When I try to include Ruby I get the following errors:
[...]
>
> I wonder if this would be a problem if I used a non-Cygwin MinGW
> distribution, but this has become too much trouble already.
> Hopefully someone can suggest a fix, or I'll just live without the
> Ruby interpreter. (+perl/dyn and +python/dyn were included without
> issue.)

I've been seeing this for a year with a Cygwin GCC build, starting
with the Ruby 1.9 series. Something changed so that Vim's build no
longer finds the necessary Ruby libraries, for me starting with
ruby.h. I've spent hours (one today!), but never could track it down.

--
Steve Hall [ digitect dancingpaper com ]

Christian J. Robinson

unread,
Nov 20, 2012, 8:04:48 PM11/20/12
to vim...@googlegroups.com
On Tue, 20 Nov 2012, Steve Hall wrote:

> On Tue, Nov 20, 2012 at 4:53 PM, Christian J. Robinson
> <hep...@gmail.com> wrote:
>>
>> I was able to get Make_ming.mak to compile a native Windows
>> gvim.exe using Cygwin's MinGW packages as long as I don't try to
>> include Ruby.
>>
>> When I try to include Ruby I get the following errors:
> [...]
>
> I've been seeing this for a year with a Cygwin GCC build, starting
> with the Ruby 1.9 series. Something changed so that Vim's build no
> longer finds the necessary Ruby libraries, for me starting with
> ruby.h. I've spent hours (one today!), but never could track it
> down.

I think in my case it's not a problem of finding the libraries (or
includes) but that the .h files included for Ruby have "collisions"
with files already included by Cygwin's standard .h files, so the
compile errors out.

I did some Googling, and found that this problem doesn't only exist
with compiling Vim, and someone suggested that it's the fault of the
Ruby .h files, which should only be defining these things if they're
not already defined. If this is the case, I wonder if the Vim sources
could somehow be tweaked to work around this problem. My C is getting
increasingly rusty, and my competence was never beyond a beginner's
level anyway, so at this point I'm not really sure how to attempt it.

- Christian

--
"If you choose not to decide, you still have made a choice." -- Rush

Ken Takata

unread,
Nov 22, 2012, 8:49:02 PM11/22/12
to vim...@googlegroups.com
Hi,

I think that Make_cyg.mak needs some additional include dirs for ruby 1.9.
After applying the attached patch, I can compile with the following command:

$ make -f Make_cyg.mak CC=gcc-3 CXX=g++-3 RUBY='/path/to/ruby1.9.3' RUBY_VER=19 RUBY_VER_LONG=1.9.1

Using i686-pc-mingw32-gcc instead of gcc-3 also works,
but i686-w64-mingw32-gcc doesn't seem to work for ruby interface.

Best regards,
Ken Takata

add-ruby-include-dirs.patch

Christian J. Robinson

unread,
Nov 22, 2012, 9:50:41 PM11/22/12
to vim...@googlegroups.com
And yet I still get the undefined reference to _pow error, regardless
of which version of gcc I use.

- Christian

--
"We are what we pretend to be, so we must be careful what we pretend to be."
-- Kurt Vonnegut

Bram Moolenaar

unread,
Nov 23, 2012, 3:44:19 PM11/23/12
to Ken Takata, vim...@googlegroups.com
Looking at Make_mvc.mak, the extra directories are only used when the
Ruby version is 1.9 or later. Not for 1.8.


--
hundred-and-one symptoms of being an internet addict:
58. You turn on your computer and turn off your wife.

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

Ken Takata

unread,
Nov 23, 2012, 9:25:00 PM11/23/12
to vim...@googlegroups.com, Ken Takata
Hi Bram,

Bram Moolenaar wrote:
> Looking at Make_mvc.mak, the extra directories are only used when the
> Ruby version is 1.9 or later. Not for 1.8.

Oh, I didn't notice that.
How about this patch?

Thanks,
Ken Takata

add-include-dirs-for-ruby19.patch

Ken Takata

unread,
Nov 24, 2012, 2:13:01 AM11/24/12
to vim...@googlegroups.com, Ken Takata
Hi Bram,

Ken Takata wrote:
> Bram Moolenaar wrote:
> > Looking at Make_mvc.mak, the extra directories are only used when the
> > Ruby version is 1.9 or later. Not for 1.8.
>
> Oh, I didn't notice that.
> How about this patch?

And I think this is the same for Make_ming.mak.

Thanks,
Ken Takata

mod-for-ruby19.patch

Ken Takata

unread,
Nov 24, 2012, 2:43:08 AM11/24/12
to vim...@googlegroups.com
Hi Christian,

2012/11/23 Fri 11:50:49 UTC+9 Heptite:

> And yet I still get the undefined reference to _pow error, regardless
> of which version of gcc I use.

Hmm, strange.
The symbol _pow is usually defined in a library libmsvcrt.a which
is linked by default.
Can you compile a program just using pow()?

For example:
$ cat a.c
#include <math.h>
int main()
{
return (int) pow(2, 3);
}

$ i686-pc-mingw32-gcc a.c (or gcc-3 -mno-cygwin a.c)

$ ./a; echo $?
8

Thanks,
Ken Takata

Christian J. Robinson

unread,
Nov 24, 2012, 11:47:57 AM11/24/12
to vim...@googlegroups.com
On Fri, 23 Nov 2012, Ken Takata wrote:

> Can you compile a program just using pow()?
>
> For example:
> $ cat a.c
> #include <math.h>
> int main()
> {
> return (int) pow(2, 3);
> }
>
> $ i686-pc-mingw32-gcc a.c (or gcc-3 -mno-cygwin a.c)
>
> $ ./a; echo $?
> 8

Yes, this works fine.


--
Please avoid sending me Word or PowerPoint attachments.
See http://www.fsf.org/philosophy/no-word-attachments.html
Reply all
Reply to author
Forward
0 new messages