[Win32utils-devel] win32-api (1.0.5) on Ruby 1.8.6 Mingw

Daniel Berger djberg96 at gmail.com
Thu Apr 17 20:05:20 EDT 2008


Gordon Thiesfeld wrote:
> When trying to compile the win32-api gem on ruby 1.8.6 (2008-03-03
> patchlevel 114) [i386-mingw32], I get the following error:
> 
> gcc -shared -s -o api.so api.o -L"." -L"C:/ruby/ruby_mingw/lib" -L.
> -Wl,--enable-auto-image-base,--enable-auto-import,--export-all
> -lmsvcrt-ruby18  -lws2_32
> api.o: In function `api_init':
> C:/ruby/ruby_mingw/lib/ruby/gems/1.8/gems/win32-api-1.0.5/ext/win32/api.c:201:
> undefined reference to `_tcscmp'
> collect2: ld returned 1 exit status
> make: *** [api.so] Error 1
> 
> Here's the relevant code from api.c (lines 200 - 204)
> 
>   /* The order of 'A' and 'W' is reversed if $KCODE is set to 'UTF8'. */
>   if(!_tcscmp(rb_get_kcode(), "UTF8")){
>      first  = "W";
>      second = "A";
>   }
> 
> Any ideas?

Yeah, I got a little overzealous with the TCHAR stuff there. Just change 
"_tcscmp" to "strcmp" and rebuild. I think I've already made this change 
in CVS, since we know $KCODE is always ASCII.

Regards,

Dan



More information about the win32utils-devel mailing list