oj: Fails to install under Windows 64

Is Windows 64 a supported platform? During the installation it fails to compile with this error (Ruby 2.0.0-p195 installed via RubyInstaller):

>gem install oj -v 2.1.0
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
ERROR:  Error installing oj:
        ERROR: Failed to build gem native extension.

    C:/Ruby200-x64/bin/ruby.exe extconf.rb
>>>>> Creating Makefile for ruby version 2.0.0 on x64-mingw32 <<<<<
creating Makefile

make
generating oj-x64-mingw32.def
compiling cache8.c
cache8.c: In function 'slot_print':
cache8.c:97:3: warning: unknown conversion type character 'l' in format [-Wforma
t]
cache8.c:97:3: warning: unknown conversion type character 'l' in format [-Wforma
t]
cache8.c:97:3: warning: too many arguments for format [-Wformat-extra-args]
compiling circarray.c
compiling compat.c
compat.c: In function 'hash_set_cstr':
compat.c:47:6: warning: implicit declaration of function 'strndup' [-Wimplicit-f
unction-declaration]
compat.c:47:26: warning: incompatible implicit declaration of built-in function
'strndup' [enabled by default]
compiling dump.c
compiling err.c
compiling fast.c
compiling hash.c
hash.c: In function 'hash_get':
hash.c:119:2: warning: implicit declaration of function 'strndup' [-Wimplicit-fu
nction-declaration]
hash.c:119:16: warning: incompatible implicit declaration of built-in function '
strndup' [enabled by default]
compiling hash_test.c
In file included from c:/Ruby200-x64/include/ruby-2.0.0/ruby/defines.h:153:0,
                 from c:/Ruby200-x64/include/ruby-2.0.0/ruby/ruby.h:70,
                 from c:/Ruby200-x64/include/ruby-2.0.0/ruby.h:33,
                 from hash.h:34,
                 from hash_test.c:33:
c:/Ruby200-x64/include/ruby-2.0.0/ruby/win32.h:276:12: error: conflicting types
for 'gettimeofday'
In file included from hash_test.c:31:0:
c:\ruby200-x64-devkit\mingw\bin\../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../
x86_64-w64-mingw32/include/sys/time.h:42:13: note: previous declaration of 'gett
imeofday' was here
hash_test.c: In function 'perf':
hash_test.c:471:5: warning: unknown conversion type character 'l' in format [-Wf
ormat]
hash_test.c:471:5: warning: too many arguments for format [-Wformat-extra-args]
make: *** [hash_test.o] Error 1


Gem files will remain installed in C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/oj-2.
1.0 for inspection.
Results logged to C:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/oj-2.1.0/ext/oj/gem_ma
ke.out

About this issue

  • Original URL
  • State: closed
  • Created 11 years ago
  • Comments: 15 (7 by maintainers)

Most upvoted comments

make DESTDIR\=
generating oj-x64-mingw32.def
compiling cache.c
compiling cache8.c
compiling circarray.c
compiling code.c
compiling compat.c
compiling custom.c
compiling debug.c
compiling dump.c
compiling dump_compat.c
compiling dump_leaf.c
compiling dump_object.c
compiling dump_strict.c
compiling err.c
compiling fast.c
fast.c: In function 'parse_json':
fast.c:776:20: warning: array subscript -16384 is outside array bounds of 'struct _parseInfo[1]' [-Warray-bounds]
  776 |     pi.stack_min = (void *)((char *)&pi - (512 * 1024));
      |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
fast.c:752:23: note: while referencing 'pi'
  752 |     struct _parseInfo pi;
      |                       ^~
compiling hash_test.c
compiling intern.c
compiling mimic_json.c
compiling object.c
compiling odd.c
compiling oj.c
compiling parse.c
compiling parser.c
In file included from parser.c:18:
C:/Ruby30-x64/msys64/mingw64/x86_64-w64-mingw32/include/sys/time.h:42:13: error: conflicting types for 'gettimeofday'
   42 | int __cdecl gettimeofday(struct timeval *__restrict__,
      |             ^~~~~~~~~~~~
In file included from C:/Ruby30-x64/include/ruby-3.0.0/ruby/internal/dosish.h:38,
                 from C:/Ruby30-x64/include/ruby-3.0.0/ruby/defines.h:79,
                 from C:/Ruby30-x64/include/ruby-3.0.0/ruby/ruby.h:23,
                 from C:/Ruby30-x64/include/ruby-3.0.0/ruby.h:38,
                 from parser.h:8,
                 from parser.c:3:
C:/Ruby30-x64/include/ruby-3.0.0/ruby/win32.h:304:12: note: previous declaration of 'gettimeofday' was here
  304 | extern int gettimeofday(struct timeval *, struct timezone *);
      |            ^~~~~~~~~~~~
make: *** [Makefile:245: parser.o] Error 1

make failed, exit code 2