为了账号安全,请及时绑定邮箱和手机立即绑定

使用 swig 为 C++ 到 javascript 创建包装器时构建错误

使用 swig 为 C++ 到 javascript 创建包装器时构建错误

九州编程 2021-08-26 17:46:05
我正在 swig 中为 javascript 构建一个 C++ 包装器。创建的 example.i 文件编译并创建了 example_wrap.cxx 文件,然后在使用 node-gyp 编译时它给出了构建错误。错误 :make: Entering directory '/home/snehabhapkar/Videos/swig/example1/build'make: *** No rule to make target 'Release/obj.target/example/example.o', needed by 'Release/obj.target/example.node'.  Stop.make: Leaving directory '/home/snehabhapkar/Videos/swig/example1/build'gyp ERR! build error gyp ERR! stack Error: `make` failed with exit code: 2gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/node-gyp/lib/build.js:196:23)gyp ERR! stack     at ChildProcess.emit (events.js:198:13)gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)gyp ERR! System Linux 5.0.9-301.fc30.x86_64gyp ERR! command "/usr/bin/node" "/usr/bin/node-gyp" "configure" "build"gyp ERR! cwd /home/snehabhapkar/Videos/swig/example1gyp ERR! node -v v10.16.0gyp ERR! node-gyp -v v5.0.3gyp ERR! not ok请帮忙 !谢谢 :)例子.i%module example%inline %{extern int gcd(int x, int y);extern double Foo;%}运行以下命令会生成 example_wrap.cxx 文件。swig -javascript -node -c++ example.i绑定.gyp{  "targets": [    {      "target_name": "example",      "sources": [ "example.cxx", "example_wrap.cxx" ]    }  ]}建筑给出了上述错误。node-gyp configure build
查看完整描述

1 回答

  • 1 回答
  • 0 关注
  • 283 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信