AudioNet / node-core-audio

Bindings for PortAudio giving JavaScript access to sound card samples (mostly unmaintained)
MIT License
330 stars 66 forks source link

Ubuntu 12.04 install fails #12

Closed richardpeng closed 11 years ago

richardpeng commented 11 years ago

Here's the error I get when i try to install the module:

> node-core-audio@0.3.3 install /usr/lib/node_modules/node-core-audio
> node-gyp rebuild

make: Entering directory `/usr/lib/node_modules/node-core-audio/build'
  CXX(target) Release/obj.target/NodeCoreAudio/NodeCoreAudio/AudioEngine.o
../NodeCoreAudio/AudioEngine.cpp: In constructor ‘Audio::AudioEngine::AudioEngine(v8::Local<v8::Function>&, v8::Local<v8::Object>, bool)’:
../NodeCoreAudio/AudioEngine.cpp:98:47: error: ‘__cdecl’ was not declared in this scope
../NodeCoreAudio/AudioEngine.cpp:98:41: error: expected primary-expression before ‘void’
../NodeCoreAudio/AudioEngine.cpp:98:41: error: expected ‘)’ before ‘void’
../NodeCoreAudio/AudioEngine.cpp: In member function ‘v8::Handle<v8::Array> Audio::AudioEngine::getInputBuffer()’:
../NodeCoreAudio/AudioEngine.cpp:251:4: warning: ‘auto’ will change meaning in C++0x; please remove it [-Wc++0x-compat]
../NodeCoreAudio/AudioEngine.cpp:251:9: error: ‘tempBuffer’ does not name a type
../NodeCoreAudio/AudioEngine.cpp:254:5: error: ‘tempBuffer’ was not declared in this scope
../NodeCoreAudio/AudioEngine.cpp:257:35: error: ‘tempBuffer’ was not declared in this scope
make: *** [Release/obj.target/NodeCoreAudio/NodeCoreAudio/AudioEngine.o] Error 1
make: Leaving directory `/usr/lib/node_modules/node-core-audio/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:789:12)
gyp ERR! System Linux 3.2.0-51-generic
gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/lib/node_modules/node-core-audio
gyp ERR! node -v v0.10.18
gyp ERR! node-gyp -v v0.10.9
gyp ERR! not ok 
npm ERR! weird error 1
npm ERR! not ok code 0

I've already installed the portaudio19-dev package. Is this the correct dependency?

ZECTBynmo commented 11 years ago

Interesting. I don't have an Ubuntu computer at my disposal right this minute, but I'll take another look later tonight

ZECTBynmo commented 11 years ago

Oh, I think you're trying to compile without C++0x. You might want to upgrade your compiler so that it can handle the new constructs like 'auto'.

ZECTBynmo commented 11 years ago

This actually still wont compile because I'm using __cdecl, which is a windows-only type. I'll see what I can do...

ZECTBynmo commented 11 years ago

Changed things around so that __cdecl isn't used, and updated the npm version. Try again please :)

richardpeng commented 11 years ago

One of the errors went away. Still failing to compile:

> node-core-audio@0.3.4 install /usr/lib/node_modules/node-core-audio
> node-gyp rebuild

make: Entering directory `/usr/lib/node_modules/node-core-audio/build'
  CXX(target) Release/obj.target/NodeCoreAudio/NodeCoreAudio/AudioEngine.o
../NodeCoreAudio/AudioEngine.cpp: In member function ‘v8::Handle<v8::Array> Audio::AudioEngine::getInputBuffer()’:
../NodeCoreAudio/AudioEngine.cpp:255:4: warning: ‘auto’ will change meaning in C++0x; please remove it [-Wc++0x-compat]
../NodeCoreAudio/AudioEngine.cpp:255:9: error: ‘tempBuffer’ does not name a type
../NodeCoreAudio/AudioEngine.cpp:258:5: error: ‘tempBuffer’ was not declared in this scope
../NodeCoreAudio/AudioEngine.cpp:261:35: error: ‘tempBuffer’ was not declared in this scope
make: *** [Release/obj.target/NodeCoreAudio/NodeCoreAudio/AudioEngine.o] Error 1
make: Leaving directory `/usr/lib/node_modules/node-core-audio/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:789:12)
gyp ERR! System Linux 3.2.0-51-generic
gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/lib/node_modules/node-core-audio
gyp ERR! node -v v0.10.18
gyp ERR! node-gyp -v v0.10.9
gyp ERR! not ok 
npm ERR! weird error 1
npm ERR! not ok code 0
ZECTBynmo commented 11 years ago

You are getting this warning

warning: ‘auto’ will change meaning in C++0x; please remove it [-Wc++0x-compat]

Which indicates to me that you're compiling without C++0x support. I'm not a linux guy, so I'm not sure how to enable C++0x features, although that -Wc++0x-compat flag seems promising.

richardpeng commented 11 years ago

I didn't need to install a new version of g++, but was able to compile by adding this to binding.gyp:

'cflags_cc': [ '-std=c++0x' ]
ZECTBynmo commented 11 years ago

Excellent, could you submit a pull request please?

richardpeng commented 11 years ago

https://github.com/ZECTBynmo/node-core-audio/pull/13

ZECTBynmo commented 11 years ago

Closing after pull request, thanks again Richard