Windows JRuby 1.6.7 win32-api build error

I’m trying to install the watir gem on windows 7. The win32-api gem
fails to build. I think the RubyInstaller devkit is properly installed
and referenced from JRuby.

The JRuby 1.6.7 release give me hope that watir is usable.

JRUBY-6454 Unable to launch browsers with watir or capybara in 1.9
mode

$ jruby -v
jruby 1.6.7 (ruby-1.9.2-p312) (2012-02-22 3e82bc8) (Java HotSpot™
Client VM 1.6.0_31) [Windows 7-x86-java]


$ gem install win32-api --version ‘~> 1.4.8’
Temporarily enhancing PATH to include DevKit…

gcc -I. -I. -Ic:/jruby/jruby-1.6.7/lib/native/include/ruby -I. -fno-
omit-frame-pointer -fno-strict-aliasing -fexceptions -m32 -
march=native -mtune=native -c win32/api.c
gcc -shared -s -o api.dll api.o -L"." -L"/jruby/jruby-1.6.7/lib" -Lc:/
jruby/jruby-1.6.7/lib/native/i386-Windows -ljruby-cext -Wl,–enable-
auto-image-base,–enable-auto-import -m32 -march=native -mtune=native
api.o:api.c:(.text+0x66c): undefined reference to SafeStringValue' ... api.o:api.c:(.text+0xe23): more undefined references to SafeStringValue’ follow

api.o:api.c:(.text+0x1171): undefined reference to `rb_str_modify’

Full error output at gist

has this worked with any versions of jruby? If not then file a jruby
jira (I guess) and try to convince the watir guys to come up with an ffi
version in the meanwhile :stuck_out_tongue:

It isn’t that hard to implement win32-api using FFI - JRuby’s Win32API
(the old one) is done that way (lib/ruby/shared/Win32API.rb)

Back to the original problem - I added those missing functions in the
cext API, for 1.7.