From: Nathan Whitney Date: 2006-07-28T01:14:20+09:00 Subject: Re: Embedded socket error So I installed 1.8.4 and couldn't compile until I changed the C:\ruby\lib\ruby\1.8\i386-mswin32\config.h to accept _MSC_VER > 1200. I then changed my code to: rubyEmbeded.cpp: ******************* #include "stdafx.h" #include "ruby.h" #include "win32\win32.h" static VALUE wrap_run( VALUE arg1 ) { rb_load_file( StringValueCStr( arg1 ) ); return Qnil; } static VALUE protected_run( VALUE script ) { int error; VALUE args[1]; VALUE result; args[0] = script; result = rb_protect( wrap_run, (VALUE)args, &error ); return error ? Qnil : result; } int _tmain(int argc, _TCHAR* argv[]) { NtInitialize(&argc, &argv); ruby_init(); ruby_init_loadpath(); ruby_script("embedded"); VALUE script = rb_str_new( "embr.rb", strlen("embr.rb") ); protected_run( script ); ruby_run(); return 0; } ********************* embr.rb: ********************* require 'socket' ********************* My results are still: Embed\rubyEmbed>Debug\rubyEmbed.exe embedded: [BUG] Segmentation fault ruby 1.8.4 (2006-04-14) [i386-mswin32] This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information. Any more thoughts? I'm not sure how I'm supposed to debug this. By the way thanks for you help so far. Nathan -- Posted via http://www.ruby-forum.com/.