mscdex / node-xxhash

An xxhash binding for node.js
Other
193 stars 28 forks source link

error: field has incomplete type 'XXH32_state_t' (aka 'XXH32_state_s') #18

Closed tuananh closed 7 years ago

tuananh commented 7 years ago

npm i on OS X returns these errors for me.

Any idea on how to fix this?


> node-gyp rebuild

  CXX(target) Release/obj.target/hash/src/hash.o
In file included from ../src/hash.cc:3:
../src/hash_32.hpp:12:19: error: field has incomplete type 'XXH32_state_t' (aka 'XXH32_state_s')
    XXH32_state_t state;
                  ^
../deps/xxhash/xxhash.h:170:16: note: forward declaration of 'XXH32_state_s'
typedef struct XXH32_state_s XXH32_state_t;   /* incomplete type */
               ^
In file included from ../src/hash.cc:3:
../src/hash_32.hpp:93:7: error: cannot initialize object parameter of type 'node::ObjectWrap' with an expression of type 'Hash32'
      obj->Wrap(info.This());
      ^~~
In file included from ../src/hash.cc:4:
../src/hash_64.hpp:12:19: error: field has incomplete type 'XXH64_state_t' (aka 'XXH64_state_s')
    XXH64_state_t state;
                  ^
../deps/xxhash/xxhash.h:228:16: note: forward declaration of 'XXH64_state_s'
typedef struct XXH64_state_s XXH64_state_t;   /* incomplete type */
               ^
In file included from ../src/hash.cc:4:
../src/hash_64.hpp:93:7: error: cannot initialize object parameter of type 'node::ObjectWrap' with an expression of type 'Hash64'
      obj->Wrap(info.This());
      ^~~
4 errors generated.```
mscdex commented 7 years ago

I'm working on updating upstream xxhash which should fix this and other issues.

tuananh commented 7 years ago

@mscdex ah i see. I'm working on that too and when remove deps/xxhash and re-add as submodule, i'm seeing this issue.

Cheers,

mscdex commented 7 years ago

This should be fixed in b9980c2.

tuananh commented 7 years ago

Cool. Thanks. Lemme try again.