On Sun, Mar 20, 2016 at 8:40 PM, Haohan Wang <[email protected]> wrote:
> My code is as following: (this is the code for constructor
> AlgorithmOptions_t)
>
> AlgorithmOptions_t(v8::Isolate* isolate, v8::Handle<v8::Object> options_v8)
> {
>    v8::Handle<v8::Value> type_handle = options_v8->Get(
>       v8::String::NewFromUtf8(isolate, "type"));
>    v8::Handle<v8::Value> max_iteration_handle = options_v8->Get(
>       v8::String::NewFromUtf8(isolate, "max_iteration"));
>    v8::Handle<v8::Value> tolerance_handle = options_v8->Get(
>       v8::String::NewFromUtf8(isolate, "tolerance"));
>    v8::Handle<v8::Value> learning_rate_handle = options_v8->Get(
>       v8::String::NewFromUtf8(isolate, "learning_rate"));
>    //v8::assert(type_handle->IsInteger(), "Expected integer algorithm
> type");
>    //v8::assert(max_iteration_handle->IsInteger(), "Expected integer number
> of iterations");
>
>    type = (algorithm_type)type_handle->IntegerValue();
>    max_iteration = max_iteration_handle->IntegerValue();
>    tolerance = tolerance_handle->NumberValue();
>    learning_rate = learning_rate_handle->NumberValue();
> }
>
> And the output compiler is as following:
> In constructor ‘AlgorithmOptions_t::AlgorithmOptions_t(v8::Isolate*,
> v8::Handle<v8::Object>)’:
> /home/haohanwang/CLion/GenAMap_V2/src/algorithm/AlgorithmOptions.hpp:25:4:
> error: ‘NewFromUtf8’ is not a member of ‘v8::String’
>     v8::String::NewFromUtf8(isolate, "type"));
>     ^
> /home/haohanwang/CLion/GenAMap_V2/src/algorithm/AlgorithmOptions.hpp:27:4:
> error: ‘NewFromUtf8’ is not a member of ‘v8::String’
>     v8::String::NewFromUtf8(isolate, "max_iteration"));
>     ^
> /home/haohanwang/CLion/GenAMap_V2/src/algorithm/AlgorithmOptions.hpp:29:4:
> error: ‘NewFromUtf8’ is not a member of ‘v8::String’
>     v8::String::NewFromUtf8(isolate, "tolerance"));
>     ^
> /home/haohanwang/CLion/GenAMap_V2/src/algorithm/AlgorithmOptions.hpp:31:4:
> error: ‘NewFromUtf8’ is not a member of ‘v8::String’
>     v8::String::NewFromUtf8(isolate, "learning_rate"));
>
> Yes, I am trying to build an add-on so that I can call my c++ code from
> node.
> Sorry that I am not entirely sure what node-gyp is. I am pretty new to node,
> sorry about that.

I can't say for sure but it's possible your project is picking up the
wrong V8 headers.  Can you try building your project with `env V=1
node-gyp rebuild` and post the complete output?

-- 
-- 
v8-users mailing list
[email protected]
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
"v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to