On Wed, 25 Jun 2003 00:25:28 +0000, Shashank Date wrote:

> I'm trying out the following example from
> the book "Making use of Ruby" (page 200,201):
> 
[snip example]

The Ruby-example code looks OK. 

 
> where the class Simple is defined using the C extension shown below.
> I compiled it using VC++ 6.0 on Win XP Pro and got no warning or errors.
> Then I copied the resulting "simple.dll" in C:\ruby\lib\ruby\site_ruby.

It is not necessary to copy the dll.  Ruby looks in the current directory
after the dll. 
 
> But when I ran the ruby code I get:
> 
> C:/ruby/lib/ruby/site_ruby/simple.dll: 126: The specified module could not
> be found.   - C:/ruby/lib/ruby/site_ruby/simple.dll (LoadError)
>  from C:/atest/tst_simple.rb:1

It seems to me that Ruby loads your file.. but cannot locate any
bootstrapping routine.  Ruby is case-sensitive. 


>
> void Init_Simple()
>          ^^^
           ^^^

Try rename 'Simple' into 'simple'
void Init_simple()  



Alternatively (the oposite solution): rename the dll into 'Simple.dll' and
change the require statement in your Ruby code into:
require 'Simple'

--
Simon Strandgaard