Bug #15754

MinGW build/compile failure with Ruby 2.5.5, but 2.6.2 & trunk ok

Added by MSP-Greg (Greg L) 13 days ago. Updated 12 days ago.

Target version:


As many of you may recall, I'm not a c type, especially regarding build errors. Recently tried to build 2.5.5 locally, and I get errors similar to the below. I do not have any errors using the same build code (ruby-loco) when building 2.6.2 or trunk.

Any help/suggestions would be appreciated... Thanks, Greg

Attached larger log with config info.

../ruby/array.c:2197:52: error: expected ')' before 'PRI_LL_PREFIX'
      rb_raise(rb_eTypeError, "wrong element type %"PRIsVALUE" at %ld (expected array)",
../ruby/array.c: In function 'rb_ary_bsearch_index':
../ruby/array.c:2676:53: error: expected ')' before 'PRI_LL_PREFIX'
      rb_raise(rb_eTypeError, "wrong argument type %"PRIsVALUE
../ruby/array.c: In function 'take_items':
../ruby/array.c:3318:49: error: expected ')' before 'PRI_LL_PREFIX'
  rb_raise(rb_eTypeError, "wrong argument type %"PRIsVALUE" (must respond to :each)",


ruby_2.5.5_build_errors_no_j.txt (6.32 KB) ruby_2.5.5_build_errors_no_j.txt MSP-Greg (Greg L), 04/07/2019 09:27 PM


Updated by nobu (Nobuyoshi Nakada) 13 days ago

PRI_LL_PREFIX should be defined in config.h by

$ grep '#define PRI_LL_PREFIX' .ext/include/x64-mingw32/ruby/config.h 
#define PRI_LL_PREFIX "I64"

Updated by MSP-Greg (Greg L) 12 days ago

nobu (Nobuyoshi Nakada)

Thanks for the reply. Stupid on my part, I overlooked the changes re gnu_printf in, and it's compiling fine.

I found the patch for it looking in an old copy of ruby-loco (using 'makepkg'). Back when Appveyor MinGW testing was added here, most of the 'build' patches needed for MinGW were also added.

All the patches currently used in ruby-loco are just for testing (ruby-loco tests from install). IOW, I totally forgot about build patches being needed.

Sorry & thanks, Greg

Updated by MSP-Greg (Greg L) 12 days ago

As to commits, see:

r64620 - Declare as gnu_printf on mingw


r64630 - use mingw ANSI stdio

Obviously, they'd need to be modified for 2.5 & 2.4, but since both are active branches, a backport would be helpful.

Ok to close...

Also available in: Atom PDF