首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >错误:‘QT_INIT_METAOBJECT’没有命名一个类型?

错误:‘QT_INIT_METAOBJECT’没有命名一个类型?
EN

Stack Overflow用户
提问于 2021-03-03 13:37:40
回答 1查看 586关注 0票数 0

我正在尝试构建一个依赖于本机包的节点项目。

环境信息:

Ubuntu 9.3.0-17ubuntu1~20.04)

  • Node

  • OS:Ubuntu 20.04

  • gcc版本: 9.3.0 (Ubuntu

  • JS版本: v9.6.1

  • npm版本: 5.6.0

  • Qt - > Qt 5.9.9 (自定义安装包括以下选项)

H 111 Qt 5.9.9 -> Desktop 64位H 212H 113 Qt 5.9.9 -> Qt网络Authorization

  • Qt 5.9.9 ->Qt脚本(Deprecated)

  • qtwebkit版本: 5.212

运行npm 后,项目将失败,并出现以下错误:

代码语言:javascript
复制
> dexi-browser-webkit@0.2.0 install /home/rando/Desktop/git/master-node/node/browser_engines/src/browsers/webkit
> node-gyp rebuild

make: Entering directory '/home/rando/Desktop/git/master-node/node/browser_engines/src/browsers/webkit/build'
  CXX(target) Release/obj.target/nodekit/native/nodekit.o
In file included from /home/rando/.node-gyp/9.6.1/include/node/node.h:63,
                 from ../native/nodekit.cc:3:
/home/rando/.node-gyp/9.6.1/include/node/v8.h: In static member function ‘static void v8::V8::RemoveGCPrologueCallback(v8::GCCallback)’:
/home/rando/.node-gyp/9.6.1/include/node/v8.h:10378:53: warning: cast between incompatible function types from ‘v8::GCCallback’ {aka ‘void (*)(v8::GCType, v8::GCCallbackFlags)’} to ‘v8::Isolate::GCCallback’ {aka ‘void (*)(v8::Isolate*, v8::GCType, v8::GCCallbackFlags)’} [-Wcast-function-type]
10378 |       reinterpret_cast<Isolate::GCCallback>(callback));
      |                                                     ^
/home/rando/.node-gyp/9.6.1/include/node/v8.h: In static member function ‘static void v8::V8::RemoveGCEpilogueCallback(v8::GCCallback)’:
/home/rando/.node-gyp/9.6.1/include/node/v8.h:10385:53: warning: cast between incompatible function types from ‘v8::GCCallback’ {aka ‘void (*)(v8::GCType, v8::GCCallbackFlags)’} to ‘v8::Isolate::GCCallback’ {aka ‘void (*)(v8::Isolate*, v8::GCType, v8::GCCallbackFlags)’} [-Wcast-function-type]
10385 |       reinterpret_cast<Isolate::GCCallback>(callback));
      |                                                     ^
In file included from ../native/nodekit.cc:5:
../node_modules/nan/nan.h: In function ‘void Nan::AsyncQueueWorker(Nan::AsyncWorker*)’:
../node_modules/nan/nan.h:2232:62: warning: cast between incompatible function types from ‘void (*)(uv_work_t*)’ {aka ‘void (*)(uv_work_s*)’} to ‘uv_after_work_cb’ {aka ‘void (*)(uv_work_s*, int)’} [-Wcast-function-type]
 2232 |     , reinterpret_cast<uv_after_work_cb>(AsyncExecuteComplete)
      |                                                              ^
In file included from /opt/Qt/5.9.9/gcc_64/include/QtCore/qlocale.h:43,
                 from /opt/Qt/5.9.9/gcc_64/include/QtGui/qguiapplication.h:47,
                 from /opt/Qt/5.9.9/gcc_64/include/QtWidgets/qapplication.h:52,
                 from /opt/Qt/5.9.9/gcc_64/include/QtWidgets/QApplication:1,
                 from ../native/nodekit.cc:9:
/opt/Qt/5.9.9/gcc_64/include/QtCore/qvariant.h: In constructor ‘QVariant::QVariant(QVariant&&)’:
/opt/Qt/5.9.9/gcc_64/include/QtCore/qvariant.h:265:25: warning: implicitly-declared ‘QVariant::Private& QVariant::Private::operator=(const QVariant::Private&)’ is deprecated [-Wdeprecated-copy]
  265 |     { other.d = Private(); }
      |                         ^
/opt/Qt/5.9.9/gcc_64/include/QtCore/qvariant.h:380:16: note: because ‘QVariant::Private’ has user-provided ‘QVariant::Private::Private(const QVariant::Private&)’
  380 |         inline Private(const Private &other) Q_DECL_NOTHROW
      |                ^~~~~~~
In file included from ../native/qt_v8.h:41,
                 from ../native/instancemap.cc:7,
                 from ../native/nodekit.cc:19:
../native/moc_qfunction.h: At global scope:
../native/moc_qfunction.h:65:1: error: ‘QT_INIT_METAOBJECT’ does not name a type
   65 | QT_INIT_METAOBJECT const QMetaObject QFunction::staticMetaObject = { {
      | ^~~~~~~~~~~~~~~~~~
In file included from ../native/nodekit.cc:3:
/home/rando/.node-gyp/9.6.1/include/node/node.h:506:43: warning: cast between incompatible function types from ‘void (*)(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE)’ {aka ‘void (*)(v8::Local<v8::Object>)’} to ‘node::addon_register_func’ {aka ‘void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, void*)’} [-Wcast-function-type]
  506 |       (node::addon_register_func) (regfunc),                          \
      |                                           ^
/home/rando/.node-gyp/9.6.1/include/node/node.h:537:3: note: in expansion of macro ‘NODE_MODULE_X’
  537 |   NODE_MODULE_X(modname, regfunc, NULL, 0)  // NOLINT (readability/null_usage)
      |   ^~~~~~~~~~~~~
../native/nodekit.cc:219:1: note: in expansion of macro ‘NODE_MODULE’
  219 | NODE_MODULE(nodekit, init)
      | ^~~~~~~~~~~
In file included from /home/rando/.node-gyp/9.6.1/include/node/node.h:63,
                 from ../native/nodekit.cc:3:
/home/rando/.node-gyp/9.6.1/include/node/v8.h: In instantiation of ‘void v8::PersistentBase<T>::SetWeak(P*, typename v8::WeakCallbackInfo<P>::Callback, v8::WeakCallbackType) [with P = node::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo<P>::Callback = void (*)(const v8::WeakCallbackInfo<node::ObjectWrap>&)]’:
/home/rando/.node-gyp/9.6.1/include/node/node_object_wrap.h:85:78:   required from here
/home/rando/.node-gyp/9.6.1/include/node/v8.h:9338:16: warning: cast between incompatible function types from ‘v8::WeakCallbackInfo<node::ObjectWrap>::Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<node::ObjectWrap>&)’} to ‘Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<void>&)’} [-Wcast-function-type]
 9338 |                reinterpret_cast<Callback>(callback), type);
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/rando/.node-gyp/9.6.1/include/node/v8.h: In instantiation of ‘void v8::PersistentBase<T>::SetWeak(P*, typename v8::WeakCallbackInfo<P>::Callback, v8::WeakCallbackType) [with P = Nan::ObjectWrap; T = v8::Object; typename v8::WeakCallbackInfo<P>::Callback = void (*)(const v8::WeakCallbackInfo<Nan::ObjectWrap>&)]’:
../node_modules/nan/nan_object_wrap.h:66:61:   required from here
/home/rando/.node-gyp/9.6.1/include/node/v8.h:9338:16: warning: cast between incompatible function types from ‘v8::WeakCallbackInfo<Nan::ObjectWrap>::Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<Nan::ObjectWrap>&)’} to ‘Callback’ {aka ‘void (*)(const v8::WeakCallbackInfo<void>&)’} [-Wcast-function-type]
make: *** [nodekit.target.mk:163: Release/obj.target/nodekit/native/nodekit.o] Error 1
make: Leaving directory '/home/rando/Desktop/git/master-node/node/browser_engines/src/browsers/webkit/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/home/rando/.nvm/versions/node/v9.6.1/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack     at ChildProcess.emit (events.js:127:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:12)
gyp ERR! System Linux 5.8.0-44-generic
gyp ERR! command "/home/rando/.nvm/versions/node/v9.6.1/bin/node" "/home/rando/.nvm/versions/node/v9.6.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/rando/Desktop/git/master-node/node/browser_engines/src/browsers/webkit
gyp ERR! node -v v9.6.1
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! dexi-browser-webkit@0.2.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the dexi-browser-webkit@0.2.0 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/rando/.npm/_logs/2021-03-03T15_53_18_987Z-debug.log
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-03-04 12:14:04

我通过执行以下操作解决了这个问题:

删除GL/gl.h文件所需的库qmake ; make clean; make -j8; node-gyp rebuild;

  • After

  • 安装了修复缺少的依赖项GL/gl.h文件的库sudo apt install mesa-common-dev libglu1-mesa-dev
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/66458212

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档