forked from mruby/mruby
-
Notifications
You must be signed in to change notification settings - Fork 0
Hello World
cremno edited this page May 3, 2014
·
10 revisions
#include <stdio.h>
#include <mruby.h>
#include <mruby/compile.h>
int
main(void)
{
mrb_state *mrb = mrb_open();
if (!mrb) { /* handle error */ }
puts("Executing Ruby code from C!");
mrb_load_string(mrb, "p 'hello world!'");
mrb_close(mrb);
return 0;
}$ gcc -Iinclude hello.c build/host/lib/libmruby.a -lm -o hello.out$ ./hello.out
Executing Ruby code from C!
"hello world!"For more information on getting started, you can read this introduction blog post.