我正在 swig 中為 javascript 構(gòu)建一個 C++ 包裝器。創(chuàng)建的 example.i 文件編譯并創(chuàng)建了 example_wrap.cxx 文件,然后在使用 node-gyp 編譯時它給出了構(gòu)建錯誤。錯誤 :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
使用 swig 為 C++ 到 javascript 創(chuàng)建包裝器時構(gòu)建錯誤
九州編程
2021-08-26 17:46:05