Gordon Thiesfeld
2008-Apr-17 23:45 UTC
[Win32utils-devel] win32-api (1.0.5) on Ruby 1.8.6 Mingw
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? Thanks, Gordon
Daniel Berger
2008-Apr-18 00:05 UTC
[Win32utils-devel] win32-api (1.0.5) on Ruby 1.8.6 Mingw
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
Gordon Thiesfeld
2008-Apr-18 14:46 UTC
[Win32utils-devel] win32-api (1.0.5) on Ruby 1.8.6 Mingw
On Thu, Apr 17, 2008 at 7:05 PM, Daniel Berger <djberg96 at gmail.com> wrote:> 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.That did the trick. Thanks.