diff --git a/Hello-World.md b/Hello-World.md index a0f007e..e17b072 100644 --- a/Hello-World.md +++ b/Hello-World.md @@ -6,8 +6,7 @@ #include #include #include -// to be replaced by #include -#include +#include int main(void) { @@ -16,7 +15,7 @@ int main(void) char code[] = "p 'hello world!'"; printf("Executing Ruby code from C!\n"); - p = mrb_parse_string(mrb, code); + p = mrb_parse_string(mrb, code, NULL); int n; n = mrb_generate_code(mrb, p->tree); mrb_run(mrb, mrb_proc_new(mrb, mrb->irep[n]), mrb_top_self(mrb)); @@ -26,5 +25,15 @@ int main(void) return 0; } ``` +compile & link +``` +$ gcc -Iinclude hello.c lib/libmruby.a -lm -o hello.out +``` +execute +``` +$ ./hello.out +Executing Ruby code from C! +"hello world!" +``` For more information on [getting started](http://matt.aimonetti.net/posts/2012/04/25/getting-started-with-mruby/), you can read this [introduction blog post](http://matt.aimonetti.net/posts/2012/04/25/getting-started-with-mruby/). \ No newline at end of file