binary module node.js

2 views
Skip to first unread message

itai...@gmail.com

unread,
Feb 16, 2014, 4:51:17 PM2/16/14
to node-...@googlegroups.com
Hello,

I am trying to build a c++ binary module for node webkit,
when compiling the code, and trying the save the callback using Persistent<Function>::New(callback);;
i'm getting compilation error
error C2440: '=' : cannot convert from 'v8::Primitive *' to 'v8::Object *volatile '          Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast

according to node.js documentation, this bug had already been resolved on version  0.11.8
which version of node webkit will be based on node 0.11.8?

Thanks!



Roger

unread,
Feb 16, 2014, 7:21:37 PM2/16/14
to itai...@gmail.com, node-...@googlegroups.com
Hello,

node-webkit v0.9.1 was released with node v0.11.9.

Thanks

--
Roger

it...@ironsrc.com

unread,
Feb 19, 2014, 3:52:37 PM2/19/14
to node-...@googlegroups.com, itai...@gmail.com
i just download 0.9.1
but still getting this compliation error
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\xlocale(323): warning C4530: C++ exception handler used, but unwind semantics are not enabled.
Specify /EHsc [C:\dev\mac_helper\build\machelper.vcxproj]
C:\Users\xxx\.nw-gyp\0.9.1\deps\v8\include\v8.h(481): error C2440: '=' : canno
t convert from 'v8::Primitive *' to 'v8::Object *volatile ' [C:\dev\mac_helper\
build\machelper.vcxproj]
          Types pointed to are unrelated; conversion requires reinterpret_cast,   C-style cast or function-style cast
          C:\Users\xxx\.nw-gyp\0.9.1\deps\v8\include\v8.h(477) : see reference   to function template instantiation 'void v8::NonCopyablePersistentTraits<T>:  :Uncompilable<v8::Object>(void)' being compiled
          with
          [
              T=v8::Function
          ]
          C:\Users\xxx\.nw-gyp\0.9.1\deps\v8\include\v8.h(5683) : see referenc  e to function template instantiation 'void v8::NonCopyablePersistentTraits<T>  ::Copy<T,v8::NonCopyablePersistentTraits<T>>(const v8::Persistent<T> &,v8::Pe  rsistent<T> *)' being compiled
          with
          [
              T=v8::Function

Roger

unread,
Feb 20, 2014, 12:05:35 AM2/20/14
to it...@ironsrc.com, node-...@googlegroups.com, itai...@gmail.com
<it...@ironsrc.com> writes:

> i just download 0.9.1
> but still getting this compliation error

There are 2 branches of node-webkit (0.9.x and 0.8.x) as you can see in
the front page. They are for Node v0.11 and v0.10 respectively. There is
an API change between the 2 versions of Node. So in the first please
make sure the Node version your module support and build it with the
correct version of node-webkit.

Thanks

--
Roger

itai...@gmail.com

unread,
Feb 20, 2014, 5:53:20 PM2/20/14
to node-...@googlegroups.com, it...@ironsrc.com, itai...@gmail.com
Roger,

I tried even on 0.9.2 which you just release a few hours ago.
I copied node-webkit latest binaries,

run nw-gyp configure --target=0.9.2

and tried to build, I see that the new directory of 0.9.2 is used, but still getting the same error.

C:\Users\xxx\.nw-gyp\0.9.2\deps\v8\include\v8.h(481): error C2440: '=' : cannot convert from 'v8::Primitive *' to 'v8::Object *volatile ' [C:\dev\nwproj\build\nwproj.vcxproj]

caused by my code:
..\src\nwproj.cc(31) : see reference to class template instantiation 'v8::Persistent<T>' being compiled

struct Request
{
Persistent<Function> callback;
};

itai...@gmail.com

unread,
Feb 22, 2014, 3:20:52 AM2/22/14
to node-...@googlegroups.com, it...@ironsrc.com, itai...@gmail.com
solved it by changing the variable to be defined as Persistent<Function,v8::CopyablePersistentTraits<Function> 
Reply all
Reply to author
Forward
0 new messages