From: Jari Williamsson Date: 2008-01-02T03:29:55+09:00 Subject: Re: Embedding Ruby into a Borland C++ Builder Application Mohit Sindhwani wrote: > I'm trying to embed Ruby as the scripting engine into a project of > mine. The project is written in Borland C++ Builder (Codergear Turbo > C++ actually). I searched around for clues on embedding Ruby in C++ > Builder but the main link I found was frm 2003 and is this one: > http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/71319 > > Is there a more recent guide for this? > > I've looked at PickAxe 2 and there's a piece of code there that explains > how to embed Ruby (PickAxe 1 has it here) > http://www.rubycentral.com/pickaxe/ext_ruby.html > > This includes "ruby.h" which I found in my distribution at: > ruby\src\ruby-1.8.6 and "ruby.h" starts by including "config.h" which it > can't find. I can't find any information on where to provide it from. config.h is system-specific and it should build when you call win32\configure.bat with your environment set up for the C++ Builder compiler and tools. To run it with C++ Builder, you need to build from sources to create a compatible .lib to link with your project. AFAIK, it's basically these steps for any Windows C++ compiler. 1. Go to a command prompt that has the settings for the compiler and make tools 2. Create a folder where you want your build and go there 3. Call win32\configure.bat to build config.h and the mak file 4. Run the make tool 5. In your C++ project, link with a lib that was created during the make In theory, that's what should make it work. Let me know how it works. Best regards, Jari Williamsson