I had the same behavior when building extensions for cygwin (with SWIG).
The reason: The EXTERN-macro is not appropriate for your platform.
The solution: In order to get the right #define's, you have (I had) to
compile your extension with the -DUSEIMPORTLIB.
Hope this helps
Clemens

> -----Urspr?ngliche Nachricht-----
> Von: Aleksei Guzev [mailto:aleksei.guzev / bigfoot.com]
> Gesendet am: Freitag, 29. Juni 2001 08:13
> An: ruby-talk / ruby-lang.org
> Betreff: [ruby-talk:17052] Problem building extension
> 
> 
> rb_cObject given to my extension by mswin32-ruby16.lib and 
> rb_cObject in
> Ruby itself are not the same.
> 
> I did not investigate the problem at all. Does anyone know 
> what's wrong?
>