From: Stefano Crocco Date: 2007-01-26T05:24:06+09:00 Subject: Re: ebedded: calling a C function from script. Alle 17:15, gioved� 25 gennaio 2007, Shea Martin ha scritto: > I tried what you said: > > ��������VALUE script_obj = rb_eval_string("self"); > ��������ID script_main_id = rb_intern("script_main"); > ��������rb_funcall( script_obj, script_main_id, 0 ); > > but it crashes with the access violation. According to one of your previous posts, you use rb_load_file to load a file, of course thinking that that was the C function corresponding to the ruby 'load' method. The problem is that this is not true. The C function corresponding to 'load' is rb_load, which takes one VALUE (the name of the file, as a ruby string) and one int (analogous to the second parameter of the ruby load method). Of course you could use the function corresponding to 'require', rb_require, which takes a char* argument with the name of the file. So, you should replace the code rb_load_file( "test.rb" ) with rb_load(rb_str_new2("test.rb"),0); or with rb_require("test.rb"); I hope this solves your problem Stefano