From: web2ed@... (Edward Wilson) Date: 2002-05-01T01:05:35+09:00 Subject: Re: Embeding Ruby ts wrote in message news:<200204300829.g3U8TpL07699@moulon.inra.fr>... > >>>>> "E" == Edward Wilson writes: > > E> I've tried linking against dl but it doesn't solve my problem. Does > E> someone have a make file I can use for Linux 2.4? I got it to compile > E> once, but can't duplicate it, I don't know what I did to get it to > E> compile. > > See [ruby-talk:36676] > > http://www.ruby-talk.org/36676 > > E> --Win: (runtime issues) > E> On XP-Pro with Visual Studio.NET I was able to compile easily, but > E> when I call embeded Ruby from within my C++ application ruby runs > E> whatever scripts I pass it but then my application exits. I don't > E> understand why my app haults after I call ruby. Shouldn't Ruby simply > > I know nothing on this but try to define -DNT and -DIMPORT > > > Guy Decoux Guy, thanks...I'm now able to compile on linux/IX86. Now I'm getting a consistant and misterious exit whenever I call embeded ruby from within a C application running on Linux or a C++ (compiled with V-Studio.NET) application running on XP-pro. I Know I'm doing something wrong. One should be able to run in a loop at the C/C++ level and call a ruby script and return to whatever they were doing in the top C/C++ layer. Am I loading the wrong version of the interpreter, or do I need to seed the interpretor with some special value other than... ruby_init(); ruby_script("embeded"); rb_load_file("hello.rb")//the ruby script I'm calling from C/C++ begin__C_loop //do some C/C++ work here ruby_run() //decide it's time to call ruby here //back to more C/C++ work here (--not getting to here--) end_C_loop My goal is to be able to call ruby whenever I have some ruby processing that I want to perfrom, then have control returned back to my C/C++ application. When I call embeded ruby, Ruby runs my script fine but then my application mysteriously quites. I know one of you out there has tackled this before. ...ed