node-cpp-modules icon indicating copy to clipboard operation
node-cpp-modules copied to clipboard

Update build instructions

Open richsad opened this issue 11 years ago • 2 comments

The README.md files for the examples say to run: npm build

Doing this does nothing on node.js 0.10.26. However, if you do: node-gyp configure node-gyp build

It builds the C++ and then do:

node run.js

You are able to use the examples. You may want to update the docs since in general the people using these examples are total newbs to building native C++ extensions for node (like me!). Thanks a lot for contributing these examples.

richsad avatar Mar 07 '14 17:03 richsad

When I do node-gyp build I get:

CXX(target) Release/obj.target/node-cpphello/cpphello.o ../cpphello.cpp:7:32: error: unknown type name 'Arguments'; did you mean 'v8::internal::Arguments'? static Handle<Value> foo(const Arguments& args) ^~~~~~~~~ v8::internal::Arguments /Users/sven/.node-gyp/0.12.0/deps/v8/include/v8.h:127:7: note: 'v8::internal::Arguments' declared here class Arguments; ^ ../cpphello.cpp:9:18: error: no member named 'New' in 'v8::String' return String::New("Hello World"); ~~~~~~~~^ ../cpphello.cpp:14:3: error: no matching function for call to 'NODE_SET_METHOD' NODE_SET_METHOD(target, "foo", foo); ^~~~~~~~~~~~~~~ /Users/sven/.node-gyp/0.12.0/src/node.h:240:25: note: expanded from macro 'NODE_SET_METHOD' #define NODE_SET_METHOD node::NODE_SET_METHOD ^~~~~~~~~~~~~~~~~~~~~ /Users/sven/.node-gyp/0.12.0/src/node.h:228:13: note: candidate function [with TypeName = v8::Handlev8::Object] not viable: no known conversion from 'Handlev8::Value (const v8::internal::Arguments &)' to 'v8::FunctionCallback' (aka 'void (*)(const FunctionCallbackInfov8::Value &)') for 3rd argument inline void NODE_SET_METHOD(const TypeName& recv, ^ 3 errors generated.

mn1aC avatar Mar 20 '15 17:03 mn1aC

Seems like v8 is not included? How to solve this?

mn1aC avatar Mar 20 '15 17:03 mn1aC