Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

does not build under osx #7

Closed
sebseb7 opened this issue Apr 8, 2012 · 13 comments
Closed

does not build under osx #7

sebseb7 opened this issue Apr 8, 2012 · 13 comments

Comments

@sebseb7
Copy link

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/sdl.cc -> build/Release/src/sdl_1.o [2/3] cxx: src/helpers.cc -> build/Release/src/helpers_1.o ../src/sdl.cc: In function 'v8::Handle<v8::Value> sdl::WaitEvent(const v8::Arguments&)': ../src/sdl.cc:284: error: invalid conversion from 'int (*)(eio_req*)' to 'void (*)(eio_req*)' ../src/sdl.cc:284: error: initializing argument 1 of 'eio_req* eio_custom(void (*)(eio_req*), int, int (*)(eio_req*), void*)' Waf: Leaving directory/Users/seb/gitrepos/astro/ceilingled/node_modules/sdl/build'
Build failed: -> task failed (err #1):
{task: cxx sdl.cc -> sdl_1.o}

@nikswap
Copy link

nikswap commented Apr 9, 2012

Same issue on xubuntu 11.10

@creationix
Copy link
Owner

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

@nikswap
Copy link

nikswap commented Apr 12, 2012

from npm

@creationix
Copy link
Owner

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

@nikswap
Copy link

nikswap commented Apr 17, 2012

Yes, that solved it, thanks :-)

@cpetzold
Copy link

npm install sdl fails for me on os x 10.7.3:

λ ~/tmp/ sdl-config --version --libs --cflags --static-libs
1.2.15
-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
v0.6.14
λ ~/tmp/ npm -v
1.1.15
λ ~/tmp/ npm install sdl
npm http GET https://registry.npmjs.org/sdl
npm http 304 https://registry.npmjs.org/sdl

> [email protected] 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',
  'binding.gyp',
  '-I/Users/cpetzold/tmp/node_modules/sdl/build/config.gypi',
  '-f',
  'make' ]
spawn make [ 'BUILDTYPE=Release', '-C', 'build' ]
  CXX(target) Release/obj.target/libnode-sdl/src/helpers.o
../src/helpers.cc:4:10: fatal error: 'SDL.h' file not found
#include <SDL.h>
         ^
1 error generated.
make: *** [Release/obj.target/libnode-sdl/src/helpers.o] 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! [email protected] install: `node-gyp rebuild`
npm ERR! `sh "-c" "node-gyp rebuild"` failed with 1
npm ERR! 
npm ERR! Failed at the [email protected] 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! code ELIFECYCLE
npm ERR! message [email protected] 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
Copy link
Author

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

em commented Sep 18, 2012

Same here. OSX 10.8.1. node v0.8.6

node-gyp rebuild

CXX(target) Release/obj.target/libnode-sdl/src/helpers.o
../src/helpers.cc:4:10: fatal error: 'SDL.h' file not found
#include <SDL.h>

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

Looks like this is the issue: http://forums.libsdl.org/viewtopic.php?t=5997&sid=73840727929628eced1704a39bdc7fba

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

@Freezerburn
Copy link
Collaborator

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.

@creationix
Copy link
Owner

@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.

@Freezerburn
Copy link
Collaborator

@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.

@creationix
Copy link
Owner

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. https://github.com/creationix/node-gamepad

@JoeriBultheel
Copy link

@Freezerburn I'm still in need of doing this. Could you please elaborate on the install instructions plse! It would help me out a lot. I'm currently lost. I cloned this repo into my node_modules directory of the project i'm working on that needs sdl. i renamed the folder from "node-sdl" to "sdl" as the node-code inlcuded a 'var SDL = require('sdl');' statement.

Could you please help me with the installation, i'm running OS X10.11, node v.4.4.7, npm 2.15.8.

Thank you

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

No branches or pull requests

7 participants