Ruby Extension/DLL Help

A

Andy Pelzer

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
 
M

Michael Davis

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
 
T

Tim Sutherland

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,141
Messages
2,570,813
Members
47,357
Latest member
sitele8746

Latest Threads

Top