From: Katsuyuki Komatsu Date: 2000-09-27T23:54:42+09:00 Subject: [ruby-dev:11084] Re: Application Error in 1.6.0 on Win2K 小松です. In the message of [ruby-dev:11083] Application Error in 1.6.0 on Win2K on 2000/9/27 23:31 matz@zetabits.com (Yukihiro Matsumoto) wrote: > [ruby-talk:5082], [ruby-talk:5154]について分かる人はいません > かね? 拡張ライブラリのコンパイル手順の問題? おそらく. 以下のように問題なく実行できます. 以下では残してますが,Init_XPTRrb()の__declspec(dllexport)も いらないです. C:\lang\XPTRrb>type extconf.rb require 'mkmf' create_makefile('XPTRrb') C:\lang\XPTRrb>type XPTRrb.c #include "ruby.h" static VALUE mXptr; static VALUE cMessage; __declspec(dllexport) void Init_XPTRrb(void) { mXptr = rb_define_module("Xptr"); cMessage = rb_define_class_under(mXptr, "Oops", rb_cObject); } C:\lang\XPTRrb>ruby extconf.rb creating Makefile C:\lang\XPTRrb>nmake -nologo cl -DIMPORT -nologo -DNT=1 -Zi -O2b2x -G5 -IC:\usr\local\lib\ruby\1.6\i586-mswin32 -IC:/usr/local/include -c -o XPTRrb.obj XPTRrb.c XPTRrb.c set LIB=C:\usr\local\lib\ruby\1.6\i586-mswin32;C:\Program Files\Microsoft Visual Studio\VC98\Lib cl -LD -DIMPORT -nologo -DNT=1 -Zi -O2b2x -G5 -o XPTRrb.so XPTRrb.obj mswin32-ruby16.lib -link /EXPORT:Init_XPTRrb ライブラリ XPTRrb.lib とオブジェクト XPTRrb.exp を作成中 C:\lang\XPTRrb>type test.rb require "XPTRrb" print "Hi!" C:\lang\XPTRrb>ruby -v -I. test.rb ruby 1.6.1 (2000-09-27) [i586-mswin32] Hi! C:\lang\XPTRrb>nmake -nologo site-install XPTRrb.so -> C:/usr/local/lib/ruby/site_ruby/1.6/i586-mswin32/XPTRrb.so chmod 0555 C:/usr/local/lib/ruby/site_ruby/1.6/i586-mswin32/XPTRrb.so C:\lang\XPTRrb> -- 小松克行 / Katsuyuki Komatsu