简体   繁体   中英

Error when trying to launch program that uses libtcod for ruby

I just installed the libtcod ruby gem , and i wanted to see if the demo works. When I start the demo, it gives me an error:

C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/ffi-1.9.8-x64-mingw32/lib/ffi/library.rb:133:in `block in ffi_lib': Coul (LoadError)ibrary 'libtcod-mingw': The specified module could not be found.
.
Could not open library 'libtcod-mingw.dll': The specified module could not be found.
.
Could not open library 'C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/libtcod-0.1.1/clib/i686/libtcod-mingw.dll': The specified moR♀)
        from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/ffi-1.9.8-x64-mingw32/lib/ffi/library.rb:100:in `map'
        from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/ffi-1.9.8-x64-mingw32/lib/ffi/library.rb:100:in `ffi_lib'
        from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/libtcod-0.1.1/lib/libtcod/bindings.rb:23:in `<module:TCOD>'

        from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/libtcod-0.1.1/lib/libtcod/bindings.rb:3:in `<top (required)>'
        from C:/Ruby21-x64/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from C:/Ruby21-x64/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/libtcod-0.1.1/lib/libtcod.rb:5:in `<top (required)>'
        from C:/Ruby21-x64/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:135:in `require'
        from C:/Ruby21-x64/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:135:in `rescue in require'
        from C:/Ruby21-x64/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:144:in `require'
        from C:/Users/<some user>/Desktop/libtcod.rb:1:in `<main>'

Had the same problem trying to get the example code to work. I fixed it by just dragging the libtcod-mingw.dll and SDL.dll into the project directory.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM