• Unable to compile ruby 2.4.0 with VS2015u3

    From knapek.mar@gmail.com@21:1/5 to All on Fri Dec 30 08:57:15 2016
    Hi all,

    I want to compile ruby 2.4.0 for Windows x86 using Visual Studio 2015 Update 3 but I'm out of luck. The configure process stops with nmake saying that cl exited with error code 0x2. Can you please help me?

    Steps to reproduce:
    mkdir c:\tmp
    cd c:\tmp
    git clone https://github.com/ruby/ruby.git
    cd ruby
    git checkout tags/v2_4_0
    mkdir build
    mkdir install
    cd build
    "c:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86 ..\win32\configure.bat --prefix=c:\tmp\ruby\install
    NMAKE : fatal error U1077: 'cl' : return code '0x2'
    Stop.

    I have Visual Stuido's compiler on %path%, the same is for binary distribution of Ruby 2.3 (from rubyinstaller.org) and GNU utilities (from gnuwin32.sf.net / getgnuwin32.sf.net).

    ruby -v
    ruby 2.3.3p222 (2016-11-21 revision 56859) [i386-mingw32]

    cl
    Microsoft (R) C/C++ Optimizing Compiler Version 19.00.24213.1 for x86

    nmake
    Microsoft (R) Program Maintenance Utility Version 14.00.24210.0

    Regards,
    Marek

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From =?UTF-8?Q?Marek_Kn=C3=A1pek?=@21:1/5 to All on Thu Jan 5 13:21:38 2017
    Nevermind, I solved it, the make process is sending compiler output to nul, compiler was complaining about missing file stdio.h. For some reason the %INCLUDE% environment variable was not pointing to its location. After fixing this, the compiler was
    complaining about missing ucrt.lib, again, for some reason the %LIB% environment variable was not pointing to its location. After fixing this, everything worked flawlessly.

    The fix was to execute these two commands before running the configure script (YMMV).

    set "INCLUDE=%INCLUDE%;c:\Program Files (x86)\Windows Kits\10\Include\10.0.10586.0\ucrt"

    set "LIB=%LIB%;c:\Program Files (x86)\Windows Kits\10\Lib\10.0.10586.0\ucrt\x86"

    Regard,
    Marek

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Hellio6@21:1/5 to All on Sun Apr 9 18:47:11 2017
    Have you try compiling ruby 2.4.1 yet? I got error while trying that.

    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'

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)