Ruby 2.4.1 compile error C2118

63 views
Skip to first unread message

hellio6

unread,
Apr 9, 2017, 9:44:32 PM4/9/17
to RubyInstaller

I try to compile ruby 2.4.1 on Windows using VS2015 community version. after configure I run nmake but getting this error. Any one successfully compile ruby 2.4.1 on Windows yet.



> nmake

Microsoft (R) Program Maintenance Utility Version 14.00.24210.0
Copyright (C) Microsoft Corporation.  All rights reserved.

        CC = cl -nologo
        LD = cl -nologo
        LDSHARED = cl -nologo -LD
        CFLAGS = -MD -Zi -W2 -wd4100 -wd4127 -wd4210 -wd4214 -wd4255 -wd4574  -wd4668 -wd4710 -wd4711 -wd4820 -wd4996  -we4028 -we4142 -O2sy-  -Zm600
        XCFLAGS = -DRUBY_EXPORT -I. -I.ext/include/x64-mswin64_140 -I./include -I. -I./enc/unicode/9.0.0
        CPPFLAGS =  -D_WIN32_WINNT=0x0600
        DLDFLAGS = -incremental:no -debug -opt:ref -opt:icf -dll
        SOLIBS =
compiling main.c
main.c
d:\ruby\ruby-2.4.1\ruby-2.4.1\include\ruby/ruby.h(106): error C2118: negative subscript
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\cl.EXE"' : return code '0x2'
Stop.

I look at ruby.h (106) and see this:


typedef char ruby_check_sizeof_voidp
[SIZEOF_VOIDP == sizeof(void*) ? 1 : -1];

How can we fix this? Any of you successfully compile ruby 2.4.1 on Windows?

hellio6

unread,
Apr 10, 2017, 1:52:07 AM4/10/17
to RubyInstaller

Now I can compile, some failure at "nmake install"



> nmake install

Microsoft (R) Program Maintenance Utility Version 14.00.23026.0

Copyright (C) Microsoft Corporation.  All rights reserved.

        CC = cl -nologo
        LD = cl -nologo
        LDSHARED = cl -nologo -LD
        CFLAGS = -MD -Zi -W2 -wd4100 -wd4127 -wd4210 -wd4214 -wd4255 -wd4574  -wd4668 -wd4710 -wd4711 -wd4820 -wd4996  -we4028 -we4142 -O2sy-  -Zm600
        XCFLAGS = -DRUBY_EXPORT -I. -I.ext/include/x64-mswin64_140 -I./include -I. -I./enc/unicode/9.0.0
        CPPFLAGS =  -D_WIN32_WINNT=0x0600
        DLDFLAGS = -incremental:no -debug -opt:ref -opt:icf -dll
        SOLIBS =
generating enc.mk
making srcs under enc
generating transdb.h
transdb.h unchanged
generating makefile exts.mk
makefile(92) : fatal error U1000: syntax error : ')' missing in macro invocation
Stop.
NMAKE : fatal error U1077: 'cd' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64\nmake.EXE"' : return code '0x2'
Stop.
Reply all
Reply to author
Forward
0 new messages