I am building a c++ wrapper to javascript in swig. Created example.i file compiled and created example_wrap.cxx file, then while compiling with node-gyp it gives build error.
Error :
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: 2
gyp 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_64
gyp ERR! command "/usr/bin/node" "/usr/bin/node-gyp" "configure" "build"
gyp ERR! cwd /home/snehabhapkar/Videos/swig/example1
gyp ERR! node -v v10.16.0
gyp ERR! node-gyp -v v5.0.3
gyp ERR! not ok
Please help ! Thank you :)
- example.i
%module example
%inline %{
extern int gcd(int x, int y);
extern double Foo;
%}
- ran following command results in generation on example_wrap.cxx file.
swig -javascript -node -c++ example.i
- binding.gyp
{
"targets": [
{
"target_name": "example",
"sources": [ "example.cxx", "example_wrap.cxx" ]
}
]
}
- Building gives above error.
node-gyp configure build