FrontierPsychiatrist / node-spotify

A module for node.js to use libspotify.
MIT License
142 stars 20 forks source link

Unclear how to install libspotify.framework on OSX #76

Closed dsiah closed 8 years ago

dsiah commented 10 years ago

Hi, pretty simple question -- I would like to install the libspotify in the correct place so that I stop getting

../src/Application.h:4:10: fatal error: 'libspotify/api.h' file not found
#include <libspotify/api.h>

this error on npm installation.

I was able to install the actual C library (I placed the framework in the directory that I was working) and compile a simple hello.c file with gcc (I am using bash) however I do not know how/where the npm installation is looking for libspotify/api.h.

I am unable to install libspotify using brew.

FrontierPsychiatrist commented 10 years ago

Hi! I think you have to copy the folder libspotify.framework from libspotify-12.1.51-Darwin-universal.zip to /Library/Frameworks.

You'll need to edit the binding.gyp as described here though if you install libspotify as a framework.

dsiah commented 10 years ago

I did not see binding.gyp file within my project or that folder. Also I have placed the libspotify.framework file in my root /Library/Frameworks folder.

FrontierPsychiatrist commented 10 years ago

After placing the library, does the same error persist?

dsiah commented 10 years ago

Yes -- I also made modifications to my .bash_profile, since I am using the framework without an IDE.

floriancargoet commented 10 years ago

brew install homebrew/binary/libspotify

dsiah commented 10 years ago

:+1: @floriancargoet Successfully installed using homebrew, but only in conjunction with Sudo.

However I am still getting the error

../src/Application.h:4:10: fatal error: 'libspotify/api.h' file not found
#include <libspotify/api.h>
floriancargoet commented 10 years ago

All I did (and that was today) was the brew install and npm install node-spotify.

HappyTobi commented 9 years ago

you have to install the "xcode command line tools" please run:

xcode-select --install
elliotboney commented 9 years ago

In case some1 else runs into this problem, I had to run this for i could npm install

sudo ln -s /Library/Frameworks/libspotify.framework/libspotify /usr/local/lib/libspotify.dylib
rmarscher commented 9 years ago

I had a similar issue with 'libspotify/api.h' file not found on OSX Yosemite with XCode 6.3.1, homebrew 0.9.5, node-gyp 1.0.3, and node 0.10.38.

I installed libspotify via homebrew. /usr/local/include/libspotify/api.h exists as does /usr/local/lib/libspotify.dylib. I don't know what node-gyp isn't finding it.

I modified binding.gyp and inserted "/usr/local/opt/libspotify/include" to the "include_dirs" array. That got it to install.

I'm not sure if that is a viable fix that I should submit a pull request for. It's just one line anyway - https://github.com/rmarscher/node-spotify/commit/72787cf3d0bf039b08ac4cd2b4a5662632b71654

It may be possible something is wrong with my system that is causing it to not look in /usr/local as it should.