[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Extending Ruby : segment violation

John Doe

10/7/2003 7:44:00 PM


I'm making my first extension to Ruby. The C file declarations look
like:


__declspec(dllexport) VALUE cImage8 = Qnil;

__declspec(dllexport) void Init_Image8()
{
printf("I get here ...\n");

cImage8 = rb_define_class("Image8",rb_cObject);

printf(" ... but I never get here.\n");

[SNIP: other methods defined ]
}

I get a segment violation during the call to rb_define_class().

I'm using Microsoft Visual Studio .NET to create my DLL (compiling it as
C) and I'm linking with the mswin32-ruby16.lib without error. Are these
mismatched in some way? Or is there something simple I need to know? I
get the same behavior if I do not export cImage8.