Issue #6498 has been reported by koba (Shinji Kobayashi).

----------------------------------------
Bug #6498: Cygwin needs $(DEFFILE) for extension libraries.
https://bugs.ruby-lang.org/issues/6498

Author: koba (Shinji Kobayashi)
Status: Open
Priority: Normal
Assignee: 
Category: build
Target version: 
ruby -v: ruby 1.9.3p231 (2012-05-25 revision 35794) [i386-cygwin]


It seems that Bug #2684 is also valid for Cygwin.
For example, "gem install glib2 atk" fails with many undefined references:
...
linking shared-object atk.so
Creating library file: libruby-atk.arbatkaction.o: In function `rg_set_description':
/usr/local/lib/ruby/gems/1.9.1/gems/atk-1.1.3/ext/atk/rbatkaction.c:68: undefined reference to `_rbg_rval2cstr'
/usr/local/lib/ruby/gems/1.9.1/gems/atk-1.1.3/ext/atk/rbatkaction.c:68: undefined reference to `_rbgobj_instance_from_ruby_object'
rbatkaction.o: In function `rg_get_keybinding':
/usr/local/lib/ruby/gems/1.9.1/gems/atk-1.1.3/ext/atk/rbatkaction.c:62: undefined reference to `_rbgobj_instance_from_ruby_object'
...
Cygwin version:
CYGWIN_NT-6.1-WOW64 nodename 1.7.15(0.260/5/3) 2012-05-09 10:25 i686 Cygwin
Ruby configuration:
CPPFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib ../ruby/configure --enable-shared --program-suffix=1.9

A possible patch and the error log is attached.



-- 
http://bugs.ruby-lang.org/