Skip to content

does not build under osx #7

sebseb7 opened this Issue Apr 8, 2012 · 12 comments

6 participants

sebseb7 commented Apr 8, 2012

node 0.6.14
sdl 1.2.15

Checking for program g++ or c++ : /usr/bin/g++
Checking for program cpp : /usr/bin/cpp
Checking for program ar : /usr/bin/ar
Checking for program ranlib : /usr/bin/ranlib
Checking for g++ : ok
Checking for node path : not found
Checking for node prefix : ok /usr/local
Checking for program sdl-config : /usr/local/bin/sdl-config
'configure' finished successfully (0.067s)
Waf: Entering directory /Users/seb/gitrepos/astro/ceilingled/node_modules/sdl/build'
[1/3] cxx: src/ -> build/Release/src/sdl_1.o
[2/3] cxx: src/ -> build/Release/src/helpers_1.o
../src/ In function 'v8::Handle<v8::Value> sdl::WaitEvent(const v8::Arguments&)':
../src/ error: invalid conversion from 'int (*)(eio_req*)' to 'void (*)(eio_req*)'
../src/ error: initializing argument 1 of 'eio_req* eio_custom(void (*)(eio_req*), int, int (*)(eio_req*), void*)'
Waf: Leaving directory
Build failed: -> task failed (err #1):
{task: cxx -> sdl_1.o}


Same issue on xubuntu 11.10


Is this from npm or from git? I thought these issues were already fixed.


from npm


Try it now, I pushed a new version that works on node v0.6.14 using node-gyp.


Yes, that solved it, thanks :-)


npm install sdl fails for me on os x 10.7.3:

λ ~/tmp/ sdl-config --version --libs --cflags --static-libs
-L/usr/local/lib -lSDLmain -lSDL -Wl,-framework,Cocoa
-I/usr/local/include/SDL -D_GNU_SOURCE=1 -D_THREAD_SAFE
-L/usr/local/lib /usr/local/lib/libSDLmain.a /usr/local/lib/libSDL.a -Wl,-framework,OpenGL -Wl,-framework,Cocoa -Wl,-framework,ApplicationServices -Wl,-framework,Carbon -Wl,-framework,AudioToolbox -Wl,-framework,AudioUnit -Wl,-framework,IOKit
λ ~/tmp/ node -v
λ ~/tmp/ npm -v
λ ~/tmp/ npm install sdl
npm http GET
npm http 304

> sdl@0.1.8 install /Users/cpetzold/tmp/node_modules/sdl
> node-gyp rebuild

info it worked if it ends with ok 
spawn python [ '/Users/cpetzold/.node-gyp/0.6.14/tools/gyp_addon',
  'make' ]
spawn make [ 'BUILDTYPE=Release', '-C', 'build' ]
  CXX(target) Release/
../src/ fatal error: 'SDL.h' file not found
#include <SDL.h>
1 error generated.
make: *** [Release/] Error 1
ERR! Error: `make` failed with exit code: 2
    at Array.0 (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:176:25)
    at EventEmitter._tickCallback (node.js:192:40)
ERR! not ok

npm ERR! sdl@0.1.8 install: `node-gyp rebuild`
npm ERR! `sh "-c" "node-gyp rebuild"` failed with 1
npm ERR! 
npm ERR! Failed at the sdl@0.1.8 install script.
npm ERR! This is most likely a problem with the sdl package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls sdl
npm ERR! There is likely additional logging output above.
npm ERR! 
npm ERR! System Darwin 11.3.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "sdl"
npm ERR! cwd /Users/cpetzold/tmp
npm ERR! node -v v0.6.14
npm ERR! npm -v 1.1.15
npm ERR! message sdl@0.1.8 install: `node-gyp rebuild`
npm ERR! message `sh "-c" "node-gyp rebuild"` failed with 1
npm ERR! errno {}
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /Users/cpetzold/tmp/npm-debug.log
npm not ok
sebseb7 commented Jul 1, 2012

I can make it build, but then:

dyld: lazy symbol binding failed: Symbol not found: _SDL_Init
Referenced from: /Users/seb/Documents/gitRepos/lightKnot/node_modules/sdl/build/Release/node-sdl.node
Expected in: dynamic lookup

dyld: Symbol not found: _SDL_Init
Referenced from: /Users/seb/Documents/gitRepos/lightKnot/node_modules/sdl/build/Release/node-sdl.node
Expected in: dynamic lookup

Trace/BPT trap: 5

em commented Sep 18, 2012

Same here. OSX 10.8.1. node v0.8.6

node-gyp rebuild

CXX(target) Release/
../src/ fatal error: 'SDL.h' file not found

I installed sdl through homebrew: /usr/local/Cellar/sdl/1.2.15/include/SDL/SDL.h

Looks like this is the issue:

Changing the includes to SDL/SDL.h seems to make it happy.


These bindings can be built on OS X right now. (my main development machine is OS X) However, the library paths are currently hardcoded to use /usr/local/lib/. I am going to be working on making it easier to build the bindings without having those paths hardcoded :)

If the problem persists with the major overhaul, please feel free to open a new issue. I am currently cleaning out old issues so that new ones with the overhaul can be brought front and center.


@Freezerburn I'm trying to use cylon to talk to a joystick on my macbook with 10.9.5. The hybridgroup repo has issues disabled. Do you have instructions for correctly installing sdl and this addon. Just installing via npm fails. I have both SDL from brew and the framework downloaded from the website.


@creationix If you still need help with this: You should pull down the repo (and not use NPM, which needs to be updated) and build from that. You might need to modify the locations that the build looks for the SDL dylibs to where brew put them, as they're hardcoded to /usr/local/lib.


Thanks. I ended up giving up entirely on SDL and using another library for gamepad support. The new bindings work great and are super easy to build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.