/*
环境:Win10
编译器:VS2019
*/
#include <ruby/ruby.h>
int main(int argc, char* argv[])
{
ruby_sysinit(&argc, &argv);
RUBY_INIT_STACK;
ruby_init();
ruby_script("ruby-interact");
ruby_init_loadpath();
rb_eval_string("p Math.sqrt(10.0)");
rb_eval_string("p Marshal.dump([0, 1, 2, 3, 4])");
rb_eval_string("p Time.now()"); // Program crashes here.
ruby_finalize();
return 0;
}
/*
环境:Win10
编译器:VS2019
*/
#include <ruby/ruby.h>
int main(int argc, char* argv[])
{
ruby_sysinit(&argc, &argv);
RUBY_INIT_STACK;
ruby_init();
ruby_script("ruby-interact");
ruby_init_loadpath();
rb_eval_string("p Math.sqrt(10.0)");
rb_eval_string("p Marshal.dump([0, 1, 2, 3, 4])");
rb_eval_string("p Time.now()"); // Program crashes here.
ruby_finalize();
return 0;
}