Skip to content
This repository has been archived by the owner on Aug 6, 2018. It is now read-only.

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

Open
basicallydan opened this issue Jul 16, 2013 · 4 comments
Open

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

basicallydan opened this issue Jul 16, 2013 · 4 comments

Comments

@basicallydan
Copy link

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!

@Burgestrand
Copy link
Owner

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
Copy link
Owner

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.

@basicallydan
Copy link
Author

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?

@Burgestrand
Copy link
Owner

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants