Extending Ruby : segment violation

D

DaZoner

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,015
Latest member
AmbrosePal

Latest Threads

Top