Hallon icon indicating copy to clipboard operation
Hallon copied to clipboard

Can't run in Windows: 'sp_build_id' does not exist

Open basicallydan opened this issue 12 years ago • 4 comments

Hey!

Thanks for making this wrapper - it's great! I'm having no problems on mac, but when I run my script on windows with the latest DLL in the directory (12.1.52) I get this error:

[WARN] You are running the Spotify gem on an unknown platform. (C:/Ruby193/lib/ruby/gems/1.9.1/gems/spotify-12.5.2/lib/spotify/util.rb:32)
[WARN] Platform: windows
bin/run.rb:18:in `eval': Function 'sp_build_id' not found in [libspotify] (FFI::NotFoundError)
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/spotify-12.5.2/lib/spotify/api.rb:24:in `attach_function'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/spotify-12.5.2/lib/spotify/api.rb:32:in `<class:API>'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/spotify-12.5.2/lib/spotify/api.rb:2:in `<module:Spotify>'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/spotify-12.5.2/lib/spotify/api.rb:1:in `<top (required)>'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/spotify-12.5.2/lib/spotify.rb:113:in `require'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/spotify-12.5.2/lib/spotify.rb:113:in `<top (required)>'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/hallon-0.18.2/lib/hallon.rb:2:in `require'
        from C:/Ruby193/lib/ruby/gems/1.9.1/gems/hallon-0.18.2/lib/hallon.rb:2:in `<top (required)>'
        from (eval):6:in `require'
        from (eval):6:in `block in <main>'
        from bin/run.rb:18:in `eval'
        from bin/run.rb:18:in `block in <main>'
        from bin/run.rb:16:in `each'
        from bin/run.rb:16:in `<main>'

Any ideas what could be going on here?

Thanks!

basicallydan avatar Jul 16 '13 13:07 basicallydan

I currently don’t own a windows machine, and I have not recently tried running Hallon on one. I believe this issue stems from the libspotify DLL using stdcall, which mangles the names in a predictable manner. It’s possible this fix might work (but I cannot try it myself):

module Spotify
  class API
    @ffi_convention = :stdcall
  end
end

require "spotify"

The warning you receive about running the gem on an unknown platform is not fixable without a new release of the spotify gem, but it is no cause for concern at the moment.

Burgestrand avatar Jul 16 '13 22:07 Burgestrand

I’ve updated the posted snippet in my comment. It should be correct now, but as I said earlier I have no way of trying it for myself at the moment.

Burgestrand avatar Jul 17 '13 16:07 Burgestrand

Hey Kim,

Thanks, I'll give that a go when I'm in the office - put that in the file where I'm requiring Hallon, right?

basicallydan avatar Jul 17 '13 20:07 basicallydan

Yep! Make sure to put it before you require Hallon.

Burgestrand avatar Jul 17 '13 21:07 Burgestrand