[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Ruby Extension/DLL Help

Andy Pelzer

11/16/2003 7:52:00 PM

Hi,

Recently i started writing a Ruby extension. This Extension is providing
access to a dll-library. It has been written in c. Compiling works fine,
but using it in Ruby always raises this error: "dlsym: win32 error 127
[..] (LoadError)". What does this error mean? I think it means, that
Ruby cannot find the dll, used by the extension, but i'm absolutely
unsure. If this is correct, where does the dll have to be? If not, what
does this error mean? Any suggestions how to fix this?

Environment: Ruby 1.8 on WinXp/Cygwin, compiler: gcc/make

Would be great if anybody could help, i'm absolutely stuck with that.

Many thanks in advance (and please excuse my bad english)

Greets

Andy


2 Answers

Michael Davis

11/17/2003 2:54:00 AM

0

I think there is an issue with cygwin on XP. I am not sure if the issue is with cygwin or XP. However, libraries built on cygwin using gcc will not load with Ruby on XP, the same code worked great on windows 2000 with cygwin but not on XP. In the end, I had to create the DLL using MS Visual C++ and put the DLL in c:\winnt\systems (or c:\windows\system). Once this was done, I used win32api to successfully access functions in the library.

Hope this helps, Michael Davis

Andy Pelzer wrote:
> Hi,
>
> Recently i started writing a Ruby extension. This Extension is providing
> access to a dll-library. It has been written in c. Compiling works fine,
> but using it in Ruby always raises this error: "dlsym: win32 error 127
> [..] (LoadError)". What does this error mean? I think it means, that
> Ruby cannot find the dll, used by the extension, but i'm absolutely
> unsure. If this is correct, where does the dll have to be? If not, what
> does this error mean? Any suggestions how to fix this?
>
> Environment: Ruby 1.8 on WinXp/Cygwin, compiler: gcc/make
>
> Would be great if anybody could help, i'm absolutely stuck with that.
>
> Many thanks in advance (and please excuse my bad english)
>
> Greets
>
> Andy
>
>
>
>


timsuth

11/22/2003 2:03:00 AM

0

In article <20031116195131.125D645A800@helium.ruby-lang.org>, Andy Pelzer wrote:
>Hi,
>
>Recently i started writing a Ruby extension. This Extension is providing
>access to a dll-library. It has been written in c. Compiling works fine,
>but using it in Ruby always raises this error: "dlsym: win32 error 127
>[..] (LoadError)". What does this error mean? I think it means, that
>Ruby cannot find the dll, used by the extension, but i'm absolutely
>unsure. If this is correct, where does the dll have to be? If not, what
>does this error mean? Any suggestions how to fix this?
>
>Environment: Ruby 1.8 on WinXp/Cygwin, compiler: gcc/make
[...]

I'm just guessing here, but I seem to recall having a similar problem when I
incorrectly capitalised the library name in `require'.

Since the Windows filesystems are not case-sensitive, the file was found and
loaded, but then the Init_Foo function could not be called. Error 127 is
"symbol not found" or similar.