Hi Nakada-san, Thank you for your replies. My main reason to use BCC is simply because we're using Codegear's Turbo C++ Professional (Borland C++ Builder) and would like to embed scripting into our application. I really like Borland C++ Builder, so I do hope that it doesn't get deprecated :( My remaining answers are inline. Nobuyoshi Nakada wrote: >> 4. This died halfway through because it could not find c0x32.obj though >> it was in the BDS\4.0\lib directory. To make this work, I went to the >> Makefile.sub and updated it to pass the OBJ file path to the ilink32 >> executable: >> LD = ilink32 -q -Gn -j"D:\Program Files\Borland\BDS\4.0\lib\" >> > > It is that your setup wasn't enough, as you need the option in > general, so put it in ilink32.cfg file. > I think that's correct - I need to update ilink32.cfg to include that. >> [Building my application] >> For the application, I chose the sample code in 'Programming Ruby' that >> shows how to embed Ruby in your application. >> 1. In Borland C++ Builder, I chose to build a C++ console application. >> When I tried to link and build this, it gave me lots of errors about >> re-definition (some shown below) >> [C++ Error] stdio.h(393): E2167 '_strerror(const char *)' was >> previously declared with the language 'C' >> > > A simple example of declarations with and without extern "C" > doesn't err: > > extern "C" void foo(void); > void foo(void); > > int main(void) > { > foo(); > return 0; > } > > I haven't tried to link C++ and am not sure why you failed. > Linking in a C program works perfectly fine. The problem that I was having was in a C++ file. I found some hints from another thread: http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/215624 Based on this, I changes win32.h - it originally has a line like: #if defined(__cplusplus) extern "C++" { #endif ((after this, in does #include for stdio.h, stdlib.h, etc.)) I changed the C++ there to "C" and then it works fine. I also had to remark out one of the lines in missing.h because it seems that one of the definitions there is now not missing :) >> 2. Then, I created the same thing as a C application and tried to link >> it with the static library. Still no go! I got a few errors for >> undefined references (below): >> [Linker Error] Error: Unresolved external '_errno' referenced from >> E:\RB_BCC\LIB\BCCWIN32-RUBY18-STATIC.LIB|file >> [Linker Error] Error: Unresolved external '__doserrno' referenced from >> E:\RB_BCC\LIB\BCCWIN32-RUBY18-STATIC.LIB|win32 >> [Linker Error] Error: Unresolved external 'WSAEnumProtocolsA' >> referenced from E:\RB_BCC\LIB\BCCWIN32-RUBY18-STATIC.LIB|win32 >> [Linker Error] Error: Unresolved external 'WSASocketA' referenced from >> E:\RB_BCC\LIB\BCCWIN32-RUBY18-STATIC.LIB|win32 >> > > Seems runtime libraries aren't linked. > I think that's the problem. Anyway, right now, the DLL version works fine. So, I shall investigate this again. > Anyway, bcc version ruby is almost dead now, and may be > deprecated in the future. > I hope not! Again, thanks for the tips! Best Regards Mohit.