我正在尝试重建node-opencv
以便与node-webkit
一起使用。为此,您需要使用nw-gyp,但我遇到了一些错误。你能否告诉我为什么会这样?
[~/nw_cv/node_modules/opencv] nw-gyp rebuild --target=0.9.2
gyp info it worked if it ends with ok
gyp info using nw-gyp@0.12.2
gyp info using node@0.10.26 | darwin | x64
gyp info spawn python
gyp info spawn args [ '/usr/local/lib/node_modules/nw-gyp/gyp/gyp_main.py',
gyp info spawn args 'binding.gyp',
gyp info spawn args '-f',
gyp info spawn args 'make',
gyp info spawn args '-I',
gyp info spawn args '/Users/moog/nw_cv/node_modules/opencv/build/config.gypi',
gyp info spawn args '-I',
gyp info spawn args '/usr/local/lib/node_modules/nw-gyp/addon.gypi',
gyp info spawn args '-I',
gyp info spawn args '/Users/moog/.nw-gyp/0.9.2/common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=/Users/moog/.nw-gyp/0.9.2',
gyp info spawn args '-Dmodule_root_dir=/Users/moog/nw_cv/node_modules/opencv',
gyp info spawn args '--depth=.',
gyp info spawn args '--generator-output',
gyp info spawn args 'build',
gyp info spawn args '-Goutput_dir=.' ]
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
CXX(target) Release/obj.target/opencv/src/init.o
In file included from ../src/init.cc:2:
../src/Point.h:13:59: error: unknown type name 'AccessorInfo'
static Handle<Value> GetX(Local<String> prop, const AccessorInfo &info);
^
../src/Point.h:14:59: error: unknown type name 'AccessorInfo'
static Handle<Value> GetY(Local<String> prop, const AccessorInfo &info);
^
../src/Point.h:15:84: error: unknown type name 'AccessorInfo'
static void RaiseImmutable(Local<String> property, Local<Value> value, const AccessorInfo& info);
^
3 errors generated.
make: *** [Release/obj.target/opencv/src/init.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/usr/local/lib/node_modules/nw-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:797:12)
gyp ERR! System Darwin 12.4.0
gyp ERR! command "node" "/usr/local/bin/nw-gyp" "rebuild" "--target=0.9.2"
gyp ERR! cwd /Users/moog/nw_cv/node_modules/opencv
gyp ERR! node -v v0.10.26
gyp ERR! nw-gyp -v v0.12.2
gyp ERR! not ok
谢谢!
答案 0 :(得分:2)
正如您所见,编译器无法找到类型AccessorInfo
。这是因为v8 API中不再有这样的类。 node-webkit v0.9.2基于节点0.11.x分支,因此由于v8 API更改,某些本机插件可能无法编译或正常工作。在这些情况下你需要使用node-webkit 0.8.x分支。