audreyt / node-webworker-threads

Lightweight Web Worker API implementation with native threads
https://npmjs.org/package/webworker-threads
Other
2.3k stars 149 forks source link

Error installing on macOS #183

Closed nicholasc closed 6 years ago

nicholasc commented 6 years ago

Node version: 10.4.0

../src/WebWorkerThreads.cc:205:3: error: reference to 'ArrayBufferAllocator' is ambiguous
  ArrayBufferAllocator a;
  ^
../src/ArrayBufferAllocator.h:3:7: note: candidate found by name lookup is 'ArrayBufferAllocator'
class ArrayBufferAllocator : public v8::ArrayBuffer::Allocator {
      ^
/Users/nicholas/.node-gyp/10.4.0/include/node/node.h:217:7: note: candidate found by name lookup is
      'node::ArrayBufferAllocator'
class ArrayBufferAllocator;
      ^
../src/WebWorkerThreads.cc:207:32: error: use of undeclared identifier 'a'
  cp.array_buffer_allocator = &a;
                               ^

Let me know if you need more information...

kraifpatrik commented 6 years ago

I've got the same problem on Ubuntu 16.04.

nicholasc commented 6 years ago

I understand that is due to a conflict between the ArrayBufferAllocator in the library and the one defined in node headers.

@audreyt what would be your approach to solve this?

We could wrap the ArrayBufferAllocator class in a namespace and access it explicitly. If that is the case I don't mind making a quick PR to fix this.

pohi8056 commented 6 years ago

Got the same problem on MacOS

nicholasc commented 6 years ago

I have the PR ready but I'm waiting for @audreyt to confirm the namespace adoption. @kraifpatrik @pohi8056, you can use my branch while waiting for this to get resolved.

https://github.com/nicholasc/node-webworker-threads/tree/fix-arraybufferallocator

audreyt commented 6 years ago

Confirmed, please submit the PR.

audreyt commented 6 years ago

Released as 0.7.14