C/C++ Addon: v8 does not accept node::Buffer::New()

288 views
Skip to first unread message

Bodo Kaiser

unread,
Apr 13, 2013, 12:44:48 PM4/13/13
to nod...@googlegroups.com
Hello,

I want to create a Buffer instance in a C++ Addon and export it.

See:
https://gist.github.com/bodokaiser/5379132

Somehow v8 does not want to except the returned value of Buffer::New because of:

  CXX(target) Release/obj.target/test/src/test.o
../src/test.cc:17:11: error: no matching member function for call to 'Close'
    scope.Close(node::Buffer::New(chunk, 4));
    ~~~~~~^~~~~
/Users/bodo/.node-gyp/0.10.4/deps/v8/include/v8.h:4328:23: note: candidate template ignored: failed template argument deduction
Local<T> HandleScope::Close(Handle<T> value) {
                      ^
1 error generated.
make: *** [Release/obj.target/test/src/test.o] Error 1


Bodo

mscdex

unread,
Apr 13, 2013, 3:49:41 PM4/13/13
to nodejs
On Apr 13, 12:44 pm, Bodo Kaiser <bodo.kai...@enabre.com> wrote:
>     scope.Close(node::Buffer::New(chunk, 4));

Try this:

scope.Close(node::Buffer::New(chunk, 4)->handle_);

Bodo Kaiser

unread,
Apr 14, 2013, 2:51:55 AM4/14/13
to nod...@googlegroups.com
Thanks again!

Bodo.
> --
> --
> Job Board: http://jobs.nodejs.org/
> Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to nod...@googlegroups.com
> To unsubscribe from this group, send email to
> nodejs+un...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en
>
> ---
> You received this message because you are subscribed to a topic in the Google Groups "nodejs" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/nodejs/yHXD-z5nfoI/unsubscribe?hl=en.
> To unsubscribe from this group and all its topics, send an email to nodejs+un...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Reply all
Reply to author
Forward
0 new messages