开发者

Ruby C extension not resolving 3rd party dlls at runtime

开发者 https://www.devze.com 2023-04-09 04:54 出处:网络
I have a Ruby C extension that is providing a ruby interface to use a third part C library. I am able to build the library, let\'s call it something.so just fine. However, it\'s compiled against the t

I have a Ruby C extension that is providing a ruby interface to use a third part C library. I am able to build the library, let's call it something.so just fine. However, it's compiled against the third party .lib and .dll files dynamically.

When I actually try to run a ruby script that has

require 'somet开发者_如何学Gohing'

it fails. Ruby doesn't know how to find the DLLs the something.so was linked against. It gives me an error like:

---------------------------
ruby.exe - System Error
---------------------------
The program can't start because SomeThirdParty.dll is missing from your computer. Try    reinstalling the program to fix this problem. 
---------------------------
OK   
---------------------------

What do I need to do to tell ruby how to find this dll? If I put all the third party dlls in the same directory as the ruby script I'm running it works, but I'd rather not do that.


Just put it in a place that is inside your PATH. A good place may be the ruby\bin directory.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号