nwjs / nw-gyp

native addon build tool for node-webkit
MIT License
195 stars 50 forks source link

Help needed with compiling bunyan module #8

Closed jodaka closed 7 years ago

jodaka commented 11 years ago

Hello

I've been trying to run my project under node-webkit and and have problem with module called bunyan. It's logger that uses some C code. My knowledges about compiling/linking C code are effectively non existent :(

what I've tried to do: 1) npm install bunyan

2) went to node_modules/bunyan/node_modules/dtrace-provider and run nw-gyp configure --target=0.5.0 and nw-gyp build

here's the output

yp info it worked if it ends with ok
gyp info using nw-gyp@0.7.3-4
gyp info using node@0.10.4 | darwin | x64
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
  ACTION binding_gyp_libusdt_target_build_libusdt .
Building libusdt for x86_64
rm -f *.gch
rm -f *.o
rm -f libusdt.a
rm -f test_usdt
rm -f test_usdt32
rm -f test_usdt64
rm -f test_mem_usage
gcc -O2 -arch x86_64   -c -o usdt.o usdt.c
gcc -O2 -arch x86_64   -c -o usdt_dof_file.o usdt_dof_file.c
gcc -arch x86_64 -o usdt_tracepoints.o -c usdt_tracepoints_x86_64.s
gcc -O2 -arch x86_64   -c -o usdt_probe.o usdt_probe.c
gcc -O2 -arch x86_64   -c -o usdt_dof.o usdt_dof.c
gcc -O2 -arch x86_64   -c -o usdt_dof_sections.o usdt_dof_sections.c
rm -f libusdt.a
ar cru libusdt.a usdt.o usdt_dof_file.o usdt_tracepoints.o usdt_probe.o usdt_dof.o usdt_dof_sections.o
ranlib libusdt.a
  TOUCH Release/obj.target/libusdt.stamp
  CXX(target) Release/obj.target/DTraceProviderBindings/dtrace_provider.o
  CXX(target) Release/obj.target/DTraceProviderBindings/dtrace_probe.o
  CXX(target) Release/obj.target/DTraceProviderBindings/dtrace_argument.o
  SOLINK_MODULE(target) Release/DTraceProviderBindings.node
ld: warning: ignoring file /Users/jodaka/git/reader/node_modules/bunyan/node_modules/dtrace-provider/libusdt/libusdt.a, file was built for archive which is not the architecture being linked (i386): /Users/jodaka/git/reader/node_modules/bunyan/node_modules/dtrace-provider/libusdt/libusdt.a
  SOLINK_MODULE(target) Release/DTraceProviderBindings.node: Finished
gyp info ok```

3) next I've tried to run my code with node-webkit and resulted with following error:
```bash
dyld: lazy symbol binding failed: Symbol not found: _usdt_create_provider
  Referenced from: /Users/jodaka/git/reader/node_modules/bunyan/node_modules/dtrace-provider/build/Release/DTraceProviderBindings.node
  Expected in: dynamic lookup

dyld: Symbol not found: _usdt_create_provider
  Referenced from: /Users/jodaka/git/reader/node_modules/bunyan/node_modules/dtrace-provider/build/Release/DTraceProviderBindings.node
  Expected in: dynamic lookup

I guess the problem is somewhere on the second step, with linking with wrong arch, but I have no idea what should I do to make it work. Can you please help me with it?

andreabat commented 11 years ago

same issue trying to use "ldapjs" module, by rebuilding dtrace-provider with node-gyp 0.10.9