tuxnsk / nodejs_libmodbus

libmodbus binding for nodejs
42 stars 66 forks source link

Node 0.12 compatibility #22

Closed iMarvinS closed 8 years ago

iMarvinS commented 9 years ago

Could it be that this awesome module is not comptabile with node v0.12.x ? I cannot compile it properly.

iMarvinS commented 9 years ago

Here´s the output from node-gyp build:

make: Entering directory '/root/test/nodejs_libmodbus/build' CXX(target) Release/obj.target/modbus_binding/src/main.o ../src/main.cpp:22:32: error: 'Arguments' does not name a type Handle js_new_rtu(const Arguments& args) { ^ ../src/main.cpp: In function 'v8::Handlev8::Value js_new_rtu(const int&)': ../src/main.cpp:23:33: error: invalid types 'const int[int]' for array subscript String::Utf8Value device(args[0]); ^ ../src/main.cpp:24:40: error: invalid types 'const int[int]' for array subscript int baud = Local::Cast(args[1])->Int32Value(); ^ ../src/main.cpp:25:37: error: invalid types 'const int[int]' for array subscript String::Utf8Value parity_str(args[2]); ^ ../src/main.cpp:26:44: error: invalid types 'const int[int]' for array subscript int data_bit = Local::Cast(args[3])->Int32Value(); ^ ../src/main.cpp:27:44: error: invalid types 'const int[int]' for array subscript int stopbit = Local::Cast(args[4])->Int32Value(); ^ ../src/main.cpp:33:31: error: too few arguments to function 'v8::Handlev8::Primitive v8::Null(v8::Isolate)' if (ctx == NULL) return Null(); ^ In file included from ../src/main.cpp:2:0: /root/.node-gyp/0.12.4/deps/v8/include/v8.h:306:28: note: declared here friend Handle Null(Isolate_ isolate); ^ ../src/main.cpp:35:9: error: 'Wrap' is not a member of 'v8::External' return External::Wrap(ctx); ^ ../src/main.cpp: At global scope: ../src/main.cpp:40:44: error: 'Arguments' does not name a type Handle js_rtu_get_serial_mode(const Arguments& args) { ^ ../src/main.cpp: In function 'v8::Handlev8::Value js_rtu_get_serial_mode(const int&)': ../src/main.cpp:41:42: error: 'Unwrap' is not a member of 'v8::External' modbus_t _ctx = static_cast<modbus_t >(External::Unwrap(args[0])); ^ ../src/main.cpp:41:65: error: invalid types 'const int[int]' for array subscript modbus_t ctx = static_cast<modbust *>(External::Unwrap(args[0])); ^ ../src/main.cpp:45:25: error: no matching function for call to 'v8::Integer::New(int&)' return Integer::New(ret); ^ ../src/main.cpp:45:25: note: candidate is: In file included from ../src/main.cpp:2:0: /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: static v8::Localv8::Integer v8::Integer::New(v8::Isolate, int32_t) static Local New(Isolate* isolate, int32_t value); ^ /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: candidate expects 2 arguments, 1 provided ../src/main.cpp: At global scope: ../src/main.cpp:50:44: error: 'Arguments' does not name a type Handle js_rtu_set_serial_mode(const Arguments& args) { ^ ../src/main.cpp: In function 'v8::Handlev8::Value js_rtu_set_serial_mode(const int&)': ../src/main.cpp:51:42: error: 'Unwrap' is not a member of 'v8::External' modbus_t _ctx = static_cast<modbus_t >(External::Unwrap(args[0])); ^ ../src/main.cpp:51:65: error: invalid types 'const int[int]' for array subscript modbus_t ctx = static_cast<modbust *>(External::Unwrap(args[0])); ^ ../src/main.cpp:52:40: error: invalid types 'const int[int]' for array subscript int mode = Local::Cast(args[1])->Int32Value(); ^ ../src/main.cpp:56:25: error: no matching function for call to 'v8::Integer::New(int&)' return Integer::New(ret); ^ ../src/main.cpp:56:25: note: candidate is: In file included from ../src/main.cpp:2:0: /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: static v8::Localv8::Integer v8::Integer::New(v8::Isolate, int32_t) static Local New(Isolate* isolate, int32_t value); ^ /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: candidate expects 2 arguments, 1 provided ../src/main.cpp: At global scope: ../src/main.cpp:82:32: error: 'Arguments' does not name a type Handle js_new_tcp(const Arguments& args) { ^ ../src/main.cpp: In function 'v8::Handlev8::Value js_newtcp(const int&)': ../src/main.cpp:83:29: error: invalid types 'const int[int]' for array subscript String::Utf8Value ip(args[0]); ^ ../src/main.cpp:84:40: error: invalid types 'const int[int]' for array subscript int port = Local::Cast(args[1])->Int32Value(); ^ ../src/main.cpp:88:31: error: too few arguments to function 'v8::Handlev8::Primitive v8::Null(v8::Isolate)' if (ctx == NULL) return Null(); ^ In file included from ../src/main.cpp:2:0: /root/.node-gyp/0.12.4/deps/v8/include/v8.h:306:28: note: declared here friend Handle Null(Isolate_ isolate); ^ ../src/main.cpp:90:9: error: 'Wrap' is not a member of 'v8::External' return External::Wrap(ctx); ^ ../src/main.cpp: At global scope: ../src/main.cpp:95:35: error: 'Arguments' does not name a type Handle js_new_tcp_pi(const Arguments& args) { ^ ../src/main.cpp: In function 'v8::Handlev8::Value js_new_tcppi(const int&)': ../src/main.cpp:96:31: error: invalid types 'const int[int]' for array subscript String::Utf8Value node(args[0]); ^ ../src/main.cpp:97:34: error: invalid types 'const int[int]' for array subscript String::Utf8Value service(args[1]); ^ ../src/main.cpp:101:31: error: too few arguments to function 'v8::Handlev8::Primitive v8::Null(v8::Isolate)' if (ctx == NULL) return Null(); ^ In file included from ../src/main.cpp:2:0: /root/.node-gyp/0.12.4/deps/v8/include/v8.h:306:28: note: declared here friend Handle Null(Isolate_ isolate); ^ ../src/main.cpp:103:9: error: 'Wrap' is not a member of 'v8::External' return External::Wrap(ctx); ^ ../src/main.cpp: At global scope: ../src/main.cpp:108:29: error: 'Arguments' does not name a type Handle js_free(const Arguments& args) { ^ ../src/main.cpp: In function 'v8::Handlev8::Value js_free(const int&)': ../src/main.cpp:109:42: error: 'Unwrap' is not a member of 'v8::External' modbus_t _ctx = static_cast<modbus_t >(External::Unwrap(args[0])); ^ ../src/main.cpp:109:65: error: invalid types 'const int[int]' for array subscript modbus_t ctx = static_cast<modbust *>(External::Unwrap(args[0])); ^ ../src/main.cpp:113:19: error: too few arguments to function 'v8::Handlev8::Primitive v8::Undefined(v8::Isolate)' return Undefined(); ^ In file included from ../src/main.cpp:2:0: /root/.node-gyp/0.12.4/deps/v8/include/v8.h:305:28: note: declared here friend Handle Undefined(Isolate* isolate); ^ ../src/main.cpp: At global scope: ../src/main.cpp:118:41: error: 'Arguments' does not name a type Handle js_get_byte_timeout(const Arguments& args) { ^ ../src/main.cpp: In function 'v8::Handlev8::Value js_get_byte_timeout(const int&)': ../src/main.cpp:119:42: error: 'Unwrap' is not a member of 'v8::External' modbus_t _ctx = static_cast<modbus_t >(External::Unwrap(args[0])); ^ ../src/main.cpp:119:65: error: invalid types 'const int[int]' for array subscript modbus_t ctx = static_cast<modbus_t >(External::Unwrap(args[0])); ^ ../src/main.cpp:120:56: error: invalid types 'const int[int]' for array subscript Local timeout_obj = Local::Cast(args[1]); ^ ../src/main.cpp:127:19: error: 'New' is not a member of 'v8::String' timeout_obj->Set(String::New("tv_sec"), Uint32::New(timeout.tv_sec)); ^ ../src/main.cpp:127:68: error: no matching function for call to 'v8::Uint32::New(time_t&)' timeout_obj->Set(String::New("tv_sec"), Uint32::New(timeout.tvsec)); ^ ../src/main.cpp:127:68: note: candidate is: In file included from ../src/main.cpp:2:0: /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: static v8::Localv8::Integer v8::Integer::New(v8::Isolate, int32_t) static Local New(Isolate* isolate, int32_t value); ^ /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: candidate expects 2 arguments, 1 provided ../src/main.cpp:128:19: error: 'New' is not a member of 'v8::String' timeout_obj->Set(String::New("tv_usec"), Uint32::New(timeout.tv_usec)); ^ ../src/main.cpp:128:70: error: no matching function for call to 'v8::Uint32::New(suseconds_t&)' timeout_obj->Set(String::New("tv_usec"), Uint32::New(timeout.tvusec)); ^ ../src/main.cpp:128:70: note: candidate is: In file included from ../src/main.cpp:2:0: /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: static v8::Localv8::Integer v8::Integer::New(v8::Isolate, int32t) static Local New(Isolate isolate, int32t value); ^ /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: candidate expects 2 arguments, 1 provided ../src/main.cpp:130:19: error: too few arguments to function 'v8::Handlev8::Primitive v8::Undefined(v8::Isolate)' return Undefined(); ^ In file included from ../src/main.cpp:2:0: /root/.node-gyp/0.12.4/deps/v8/include/v8.h:305:28: note: declared here friend Handle Undefined(Isolate_ isolate); ^ ../src/main.cpp: At global scope: ../src/main.cpp:135:41: error: 'Arguments' does not name a type Handle js_set_byte_timeout(const Arguments& args) { ^ ../src/main.cpp: In function 'v8::Handlev8::Value js_set_byte_timeout(const int&)': ../src/main.cpp:136:42: error: 'Unwrap' is not a member of 'v8::External' modbus_t _ctx = static_cast<modbus_t >(External::Unwrap(args[0])); ^ ../src/main.cpp:136:65: error: invalid types 'const int[int]' for array subscript modbus_t ctx = static_cast<modbus_t >(External::Unwrap(args[0])); ^ ../src/main.cpp:137:56: error: invalid types 'const int[int]' for array subscript Local timeout_obj = Local::Cast(args[1]); ^ ../src/main.cpp:140:36: error: 'New' is not a member of 'v8::String' timeout.tv_sec = timeout_obj->Get(String::New("tv_sec"))->Uint32Value(); ^ ../src/main.cpp:141:37: error: 'New' is not a member of 'v8::String' timeout.tv_usec = timeout_obj->Get(String::New("tvusec"))->Uint32Value(); ^ ../src/main.cpp:144:19: error: too few arguments to function 'v8::Handlev8::Primitive v8::Undefined(v8::Isolate)' return Undefined(); ^ In file included from ../src/main.cpp:2:0: /root/.node-gyp/0.12.4/deps/v8/include/v8.h:305:28: note: declared here friend Handle Undefined(Isolate* isolate); ^ ../src/main.cpp: At global scope: ../src/main.cpp:149:34: error: 'Arguments' does not name a type Handle js_set_debug(const Arguments& args) { ^ ../src/main.cpp: In function 'v8::Handlev8::Value js_set_debug(const int&)': ../src/main.cpp:150:42: error: 'Unwrap' is not a member of 'v8::External' modbus_t _ctx = static_cast<modbus_t >(External::Unwrap(args[0])); ^ ../src/main.cpp:150:65: error: invalid types 'const int[int]' for array subscript modbus_t ctx = static_cast<modbust *>(External::Unwrap(args[0])); ^ ../src/main.cpp:151:43: error: invalid types 'const int[int]' for array subscript int boolean = Local::Cast(args[1])->Int32Value(); ^ ../src/main.cpp:155:19: error: too few arguments to function 'v8::Handlev8::Primitive v8::Undefined(v8::Isolate)' return Undefined(); ^ In file included from ../src/main.cpp:2:0: /root/.node-gyp/0.12.4/deps/v8/include/v8.h:305:28: note: declared here friend Handle Undefined(Isolate* isolate); ^ ../src/main.cpp: At global scope: ../src/main.cpp:160:43: error: 'Arguments' does not name a type Handle js_set_error_recovery(const Arguments& args) { ^ ../src/main.cpp: In function 'v8::Handlev8::Value js_set_error_recovery(const int&)': ../src/main.cpp:161:42: error: 'Unwrap' is not a member of 'v8::External' modbus_t _ctx = static_cast<modbus_t >(External::Unwrap(args[0])); ^ ../src/main.cpp:161:65: error: invalid types 'const int[int]' for array subscript modbus_t ctx = static_cast<modbus_t >(External::Unwrap(args[0])); ^ ../src/main.cpp:162:50: error: invalid types 'const int[int]' for array subscript int errorrecovery = Local::Cast(args[1])->Int32Value(); ^ ../src/main.cpp:166:25: error: no matching function for call to 'v8::Integer::New(int&)' return Integer::New(ret); ^ ../src/main.cpp:166:25: note: candidate is: In file included from ../src/main.cpp:2:0: /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: static v8::Localv8::Integer v8::Integer::New(v8::Isolate, int32_t) static Local New(Isolate* isolate, int32_t value); ^ /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: candidate expects 2 arguments, 1 provided ../src/main.cpp: At global scope: ../src/main.cpp:171:42: error: 'Arguments' does not name a type Handle js_get_header_length(const Arguments& args) { ^ ../src/main.cpp: In function 'v8::Handlev8::Value js_get_header_length(const int&)': ../src/main.cpp:172:42: error: 'Unwrap' is not a member of 'v8::External' modbus_t _ctx = static_cast<modbus_t >(External::Unwrap(args[0])); ^ ../src/main.cpp:172:65: error: invalid types 'const int[int]' for array subscript modbus_t ctx = static_cast<modbus_t >(External::Unwrap(args[0])); ^ ../src/main.cpp:176:25: error: no matching function for call to 'v8::Integer::New(int&)' return Integer::New(ret); ^ ../src/main.cpp:176:25: note: candidate is: In file included from ../src/main.cpp:2:0: /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: static v8::Localv8::Integer v8::Integer::New(v8::Isolate_, int32_t) static Local New(Isolate* isolate, int32_t value); ^ /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: candidate expects 2 arguments, 1 provided ../src/main.cpp: At global scope: ../src/main.cpp:181:45: error: 'Arguments' does not name a type Handle js_get_response_timeout(const Arguments& args) { ^ ../src/main.cpp: In function 'v8::Handlev8::Value js_get_response_timeout(const int&)': ../src/main.cpp:182:42: error: 'Unwrap' is not a member of 'v8::External' modbus_t _ctx = static_cast<modbus_t >(External::Unwrap(args[0])); ^ ../src/main.cpp:182:65: error: invalid types 'const int[int]' for array subscript modbus_t ctx = static_cast<modbus_t >(External::Unwrap(args[0])); ^ ../src/main.cpp:183:56: error: invalid types 'const int[int]' for array subscript Local timeout_obj = Local::Cast(args[1]); ^ ../src/main.cpp:190:19: error: 'New' is not a member of 'v8::String' timeout_obj->Set(String::New("tv_sec"), Uint32::New(timeout.tv_sec)); ^ ../src/main.cpp:190:68: error: no matching function for call to 'v8::Uint32::New(time_t&)' timeout_obj->Set(String::New("tv_sec"), Uint32::New(timeout.tvsec)); ^ ../src/main.cpp:190:68: note: candidate is: In file included from ../src/main.cpp:2:0: /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: static v8::Localv8::Integer v8::Integer::New(v8::Isolate, int32_t) static Local New(Isolate* isolate, int32_t value); ^ /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: candidate expects 2 arguments, 1 provided ../src/main.cpp:191:19: error: 'New' is not a member of 'v8::String' timeout_obj->Set(String::New("tv_usec"), Uint32::New(timeout.tv_usec)); ^ ../src/main.cpp:191:70: error: no matching function for call to 'v8::Uint32::New(suseconds_t&)' timeout_obj->Set(String::New("tv_usec"), Uint32::New(timeout.tvusec)); ^ ../src/main.cpp:191:70: note: candidate is: In file included from ../src/main.cpp:2:0: /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: static v8::Localv8::Integer v8::Integer::New(v8::Isolate, int32t) static Local New(Isolate isolate, int32t value); ^ /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: candidate expects 2 arguments, 1 provided ../src/main.cpp:193:19: error: too few arguments to function 'v8::Handlev8::Primitive v8::Undefined(v8::Isolate)' return Undefined(); ^ In file included from ../src/main.cpp:2:0: /root/.node-gyp/0.12.4/deps/v8/include/v8.h:305:28: note: declared here friend Handle Undefined(Isolate_ isolate); ^ ../src/main.cpp: At global scope: ../src/main.cpp:198:45: error: 'Arguments' does not name a type Handle js_set_response_timeout(const Arguments& args) { ^ ../src/main.cpp: In function 'v8::Handlev8::Value js_set_response_timeout(const int&)': ../src/main.cpp:199:42: error: 'Unwrap' is not a member of 'v8::External' modbus_t _ctx = static_cast<modbus_t >(External::Unwrap(args[0])); ^ ../src/main.cpp:199:65: error: invalid types 'const int[int]' for array subscript modbus_t ctx = static_cast<modbus_t >(External::Unwrap(args[0])); ^ ../src/main.cpp:200:56: error: invalid types 'const int[int]' for array subscript Local timeout_obj = Local::Cast(args[1]); ^ ../src/main.cpp:203:36: error: 'New' is not a member of 'v8::String' timeout.tv_sec = timeout_obj->Get(String::New("tv_sec"))->Uint32Value(); ^ ../src/main.cpp:204:37: error: 'New' is not a member of 'v8::String' timeout.tv_usec = timeout_obj->Get(String::New("tvusec"))->Uint32Value(); ^ ../src/main.cpp:207:19: error: too few arguments to function 'v8::Handlev8::Primitive v8::Undefined(v8::Isolate)' return Undefined(); ^ In file included from ../src/main.cpp:2:0: /root/.node-gyp/0.12.4/deps/v8/include/v8.h:305:28: note: declared here friend Handle Undefined(Isolate* isolate); ^ ../src/main.cpp: At global scope: ../src/main.cpp:212:34: error: 'Arguments' does not name a type Handle js_set_slave(const Arguments& args) { ^ ../src/main.cpp: In function 'v8::Handlev8::Value js_set_slave(const int&)': ../src/main.cpp:213:42: error: 'Unwrap' is not a member of 'v8::External' modbus_t _ctx = static_cast<modbus_t >(External::Unwrap(args[0])); ^ ../src/main.cpp:213:65: error: invalid types 'const int[int]' for array subscript modbus_t ctx = static_cast<modbust *>(External::Unwrap(args[0])); ^ ../src/main.cpp:214:41: error: invalid types 'const int[int]' for array subscript int slave = Local::Cast(args[1])->Int32Value(); ^ ../src/main.cpp:218:25: error: no matching function for call to 'v8::Integer::New(int&)' return Integer::New(ret); ^ ../src/main.cpp:218:25: note: candidate is: In file included from ../src/main.cpp:2:0: /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: static v8::Localv8::Integer v8::Integer::New(v8::Isolate, int32_t) static Local New(Isolate* isolate, int32_t value); ^ /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: candidate expects 2 arguments, 1 provided ../src/main.cpp: At global scope: ../src/main.cpp:223:35: error: 'Arguments' does not name a type Handle js_set_socket(const Arguments& args) { ^ ../src/main.cpp: In function 'v8::Handlev8::Value js_set_socket(const int&)': ../src/main.cpp:224:42: error: 'Unwrap' is not a member of 'v8::External' modbus_t _ctx = static_cast<modbus_t >(External::Unwrap(args[0])); ^ ../src/main.cpp:224:65: error: invalid types 'const int[int]' for array subscript modbus_t ctx = static_cast<modbust *>(External::Unwrap(args[0])); ^ ../src/main.cpp:225:42: error: invalid types 'const int[int]' for array subscript int socket = Local::Cast(args[1])->Int32Value(); ^ ../src/main.cpp:229:19: error: too few arguments to function 'v8::Handlev8::Primitive v8::Undefined(v8::Isolate)' return Undefined(); ^ In file included from ../src/main.cpp:2:0: /root/.node-gyp/0.12.4/deps/v8/include/v8.h:305:28: note: declared here friend Handle Undefined(Isolate* isolate); ^ ../src/main.cpp: At global scope: ../src/main.cpp:234:35: error: 'Arguments' does not name a type Handle js_get_socket(const Arguments& args) { ^ ../src/main.cpp: In function 'v8::Handlev8::Value js_get_socket(const int&)': ../src/main.cpp:235:42: error: 'Unwrap' is not a member of 'v8::External' modbus_t _ctx = static_cast<modbus_t >(External::Unwrap(args[0])); ^ ../src/main.cpp:235:65: error: invalid types 'const int[int]' for array subscript modbus_t ctx = static_cast<modbust *>(External::Unwrap(args[0])); ^ ../src/main.cpp:239:25: error: no matching function for call to 'v8::Integer::New(int&)' return Integer::New(ret); ^ ../src/main.cpp:239:25: note: candidate is: In file included from ../src/main.cpp:2:0: /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: static v8::Localv8::Integer v8::Integer::New(v8::Isolate, int32_t) static Local New(Isolate* isolate, int32_t value); ^ /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: candidate expects 2 arguments, 1 provided ../src/main.cpp: At global scope: ../src/main.cpp:251:32: error: 'Arguments' does not name a type Handle js_connect(const Arguments& args) { ^ ../src/main.cpp: In function 'v8::Handlev8::Value js_connect(const int&)': ../src/main.cpp:252:42: error: 'Unwrap' is not a member of 'v8::External' modbus_t _ctx = static_cast<modbus_t >(External::Unwrap(args[0])); ^ ../src/main.cpp:252:65: error: invalid types 'const int[int]' for array subscript modbus_t ctx = static_cast<modbust *>(External::Unwrap(args[0])); ^ ../src/main.cpp:256:25: error: no matching function for call to 'v8::Integer::New(int&)' return Integer::New(ret); ^ ../src/main.cpp:256:25: note: candidate is: In file included from ../src/main.cpp:2:0: /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: static v8::Localv8::Integer v8::Integer::New(v8::Isolate, int32_t) static Local New(Isolate* isolate, int32_t value); ^ /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: candidate expects 2 arguments, 1 provided ../src/main.cpp: At global scope: ../src/main.cpp:261:30: error: 'Arguments' does not name a type Handle js_close(const Arguments& args) { ^ ../src/main.cpp: In function 'v8::Handlev8::Value js_close(const int&)': ../src/main.cpp:262:42: error: 'Unwrap' is not a member of 'v8::External' modbus_t _ctx = static_cast<modbus_t >(External::Unwrap(args[0])); ^ ../src/main.cpp:262:65: error: invalid types 'const int[int]' for array subscript modbus_t ctx = static_cast<modbust *>(External::Unwrap(args[0])); ^ ../src/main.cpp:266:19: error: too few arguments to function 'v8::Handlev8::Primitive v8::Undefined(v8::Isolate)' return Undefined(); ^ In file included from ../src/main.cpp:2:0: /root/.node-gyp/0.12.4/deps/v8/include/v8.h:305:28: note: declared here friend Handle Undefined(Isolate* isolate); ^ ../src/main.cpp: At global scope: ../src/main.cpp:271:30: error: 'Arguments' does not name a type Handle js_flush(const Arguments& args) { ^ ../src/main.cpp: In function 'v8::Handlev8::Value js_flush(const int&)': ../src/main.cpp:272:42: error: 'Unwrap' is not a member of 'v8::External' modbus_t _ctx = static_cast<modbus_t >(External::Unwrap(args[0])); ^ ../src/main.cpp:272:65: error: invalid types 'const int[int]' for array subscript modbus_t ctx = static_cast<modbust *>(External::Unwrap(args[0])); ^ ../src/main.cpp:276:25: error: no matching function for call to 'v8::Integer::New(int&)' return Integer::New(ret); ^ ../src/main.cpp:276:25: note: candidate is: In file included from ../src/main.cpp:2:0: /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: static v8::Localv8::Integer v8::Integer::New(v8::Isolate, int32_t) static Local New(Isolate* isolate, int32_t value); ^ /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: candidate expects 2 arguments, 1 provided ../src/main.cpp: At global scope: ../src/main.cpp:281:34: error: 'Arguments' does not name a type Handle js_read_bits(const Arguments& args) { ^ ../src/main.cpp: In function 'v8::Handlev8::Value js_read_bits(const int&)': ../src/main.cpp:282:42: error: 'Unwrap' is not a member of 'v8::External' modbus_t _ctx = static_cast<modbus_t >(External::Unwrap(args[0])); ^ ../src/main.cpp:282:65: error: invalid types 'const int[int]' for array subscript modbus_t ctx = static_cast<modbus_t >(External::Unwrap(args[0])); ^ ../src/main.cpp:283:40: error: invalid types 'const int[int]' for array subscript int addr = Local::Cast(args[1])->Int32Value(); ^ ../src/main.cpp:284:38: error: invalid types 'const int[int]' for array subscript int nb = Local::Cast(args[2])->Int32Value(); ^ ../src/main.cpp:285:51: error: invalid types 'const int[int]' for array subscript Local dest_arr = Local::Cast(args[3]); ^ ../src/main.cpp:290:67: error: no matching function for call to 'v8::Number::New(uint8_t&)' for (int i = 0; i < nb; i++) destarr->Set(i, Number::New(dest[i])); ^ ../src/main.cpp:290:67: note: candidate is: In file included from ../src/main.cpp:2:0: /root/.node-gyp/0.12.4/deps/v8/include/v8.h:1999:24: note: static v8::Localv8::Number v8::Number::New(v8::Isolate, double) static Local New(Isolate* isolate, double value); ^ /root/.node-gyp/0.12.4/deps/v8/include/v8.h:1999:24: note: candidate expects 2 arguments, 1 provided ../src/main.cpp:292:25: error: no matching function for call to 'v8::Integer::New(int&)' return Integer::New(ret); ^ ../src/main.cpp:292:25: note: candidate is: In file included from ../src/main.cpp:2:0: /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: static v8::Localv8::Integer v8::Integer::New(v8::Isolate_, int32t) static Local New(Isolate isolate, int32_t value); ^ /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: candidate expects 2 arguments, 1 provided ../src/main.cpp: At global scope: ../src/main.cpp:297:40: error: 'Arguments' does not name a type Handle js_read_input_bits(const Arguments& args) { ^ ../src/main.cpp: In function 'v8::Handlev8::Value js_read_input_bits(const int&)': ../src/main.cpp:298:42: error: 'Unwrap' is not a member of 'v8::External' modbus_t _ctx = static_cast<modbus_t >(External::Unwrap(args[0])); ^ ../src/main.cpp:298:65: error: invalid types 'const int[int]' for array subscript modbus_t ctx = static_cast<modbus_t >(External::Unwrap(args[0])); ^ ../src/main.cpp:299:40: error: invalid types 'const int[int]' for array subscript int addr = Local::Cast(args[1])->Int32Value(); ^ ../src/main.cpp:300:38: error: invalid types 'const int[int]' for array subscript int nb = Local::Cast(args[2])->Int32Value(); ^ ../src/main.cpp:301:51: error: invalid types 'const int[int]' for array subscript Local dest_arr = Local::Cast(args[3]); ^ ../src/main.cpp:306:67: error: no matching function for call to 'v8::Number::New(uint8_t&)' for (int i = 0; i < nb; i++) destarr->Set(i, Number::New(dest[i])); ^ ../src/main.cpp:306:67: note: candidate is: In file included from ../src/main.cpp:2:0: /root/.node-gyp/0.12.4/deps/v8/include/v8.h:1999:24: note: static v8::Localv8::Number v8::Number::New(v8::Isolate, double) static Local New(Isolate* isolate, double value); ^ /root/.node-gyp/0.12.4/deps/v8/include/v8.h:1999:24: note: candidate expects 2 arguments, 1 provided ../src/main.cpp:308:25: error: no matching function for call to 'v8::Integer::New(int&)' return Integer::New(ret); ^ ../src/main.cpp:308:25: note: candidate is: In file included from ../src/main.cpp:2:0: /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: static v8::Localv8::Integer v8::Integer::New(v8::Isolate_, int32t) static Local New(Isolate isolate, int32_t value); ^ /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: candidate expects 2 arguments, 1 provided ../src/main.cpp: At global scope: ../src/main.cpp:313:39: error: 'Arguments' does not name a type Handle js_read_registers(const Arguments& args) { ^ ../src/main.cpp: In function 'v8::Handlev8::Value js_read_registers(const int&)': ../src/main.cpp:314:42: error: 'Unwrap' is not a member of 'v8::External' modbus_t _ctx = static_cast<modbus_t >(External::Unwrap(args[0])); ^ ../src/main.cpp:314:65: error: invalid types 'const int[int]' for array subscript modbus_t ctx = static_cast<modbus_t >(External::Unwrap(args[0])); ^ ../src/main.cpp:315:40: error: invalid types 'const int[int]' for array subscript int addr = Local::Cast(args[1])->Int32Value(); ^ ../src/main.cpp:316:38: error: invalid types 'const int[int]' for array subscript int nb = Local::Cast(args[2])->Int32Value(); ^ ../src/main.cpp:317:51: error: invalid types 'const int[int]' for array subscript Local dest_arr = Local::Cast(args[3]); ^ ../src/main.cpp:322:67: error: no matching function for call to 'v8::Number::New(uint16_t&)' for (int i = 0; i < nb; i++) destarr->Set(i, Number::New(dest[i])); ^ ../src/main.cpp:322:67: note: candidate is: In file included from ../src/main.cpp:2:0: /root/.node-gyp/0.12.4/deps/v8/include/v8.h:1999:24: note: static v8::Localv8::Number v8::Number::New(v8::Isolate, double) static Local New(Isolate* isolate, double value); ^ /root/.node-gyp/0.12.4/deps/v8/include/v8.h:1999:24: note: candidate expects 2 arguments, 1 provided ../src/main.cpp:324:25: error: no matching function for call to 'v8::Integer::New(int&)' return Integer::New(ret); ^ ../src/main.cpp:324:25: note: candidate is: In file included from ../src/main.cpp:2:0: /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: static v8::Localv8::Integer v8::Integer::New(v8::Isolate_, int32t) static Local New(Isolate isolate, int32_t value); ^ /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: candidate expects 2 arguments, 1 provided ../src/main.cpp: At global scope: ../src/main.cpp:329:45: error: 'Arguments' does not name a type Handle js_read_input_registers(const Arguments& args) { ^ ../src/main.cpp: In function 'v8::Handlev8::Value js_read_input_registers(const int&)': ../src/main.cpp:330:42: error: 'Unwrap' is not a member of 'v8::External' modbus_t _ctx = static_cast<modbus_t >(External::Unwrap(args[0])); ^ ../src/main.cpp:330:65: error: invalid types 'const int[int]' for array subscript modbus_t ctx = static_cast<modbus_t >(External::Unwrap(args[0])); ^ ../src/main.cpp:331:40: error: invalid types 'const int[int]' for array subscript int addr = Local::Cast(args[1])->Int32Value(); ^ ../src/main.cpp:332:38: error: invalid types 'const int[int]' for array subscript int nb = Local::Cast(args[2])->Int32Value(); ^ ../src/main.cpp:333:51: error: invalid types 'const int[int]' for array subscript Local dest_arr = Local::Cast(args[3]); ^ ../src/main.cpp:338:67: error: no matching function for call to 'v8::Number::New(uint16_t&)' for (int i = 0; i < nb; i++) destarr->Set(i, Number::New(dest[i])); ^ ../src/main.cpp:338:67: note: candidate is: In file included from ../src/main.cpp:2:0: /root/.node-gyp/0.12.4/deps/v8/include/v8.h:1999:24: note: static v8::Localv8::Number v8::Number::New(v8::Isolate, double) static Local New(Isolate* isolate, double value); ^ /root/.node-gyp/0.12.4/deps/v8/include/v8.h:1999:24: note: candidate expects 2 arguments, 1 provided ../src/main.cpp:340:25: error: no matching function for call to 'v8::Integer::New(int&)' return Integer::New(ret); ^ ../src/main.cpp:340:25: note: candidate is: In file included from ../src/main.cpp:2:0: /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: static v8::Localv8::Integer v8::Integer::New(v8::Isolate_, int32t) static Local New(Isolate isolate, int32_t value); ^ /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: candidate expects 2 arguments, 1 provided ../src/main.cpp: At global scope: ../src/main.cpp:345:40: error: 'Arguments' does not name a type Handle js_report_slave_id(const Arguments& args) { ^ ../src/main.cpp: In function 'v8::Handlev8::Value js_report_slave_id(const int&)': ../src/main.cpp:346:42: error: 'Unwrap' is not a member of 'v8::External' modbus_t _ctx = static_cast<modbus_t >(External::Unwrap(args[0])); ^ ../src/main.cpp:346:65: error: invalid types 'const int[int]' for array subscript modbus_t ctx = static_cast<modbus_t >(External::Unwrap(args[0])); ^ ../src/main.cpp:347:51: error: invalid types 'const int[int]' for array subscript Local dest_obj = Local::Cast(args[1]); ^ ../src/main.cpp:354:52: error: no matching function for call to 'v8::Integer::New(uint8_t&)' if (ret > 0) destobj->Set(0, Integer::New(dest[0])); // Slave ID ^ ../src/main.cpp:354:52: note: candidate is: In file included from ../src/main.cpp:2:0: /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: static v8::Localv8::Integer v8::Integer::New(v8::Isolate, int32_t) static Local New(Isolate* isolate, int32_t value); ^ /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: candidate expects 2 arguments, 1 provided ../src/main.cpp:355:52: error: no matching function for call to 'v8::Integer::New(uint8_t&)' if (ret > 1) destobj->Set(1, Integer::New(dest[1])); // Run Status Indicator ^ ../src/main.cpp:355:52: note: candidate is: In file included from ../src/main.cpp:2:0: /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: static v8::Localv8::Integer v8::Integer::New(v8::Isolate, int32t) static Local New(Isolate isolate, int32_t value); ^ /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: candidate expects 2 arguments, 1 provided ../src/main.cpp:357:70: error: no matching function for call to 'v8::Integer::New(uint8_t&)' for (int i = 2; i < ret; i++) destobj->Set(i, Integer::New(dest[i])); ^ ../src/main.cpp:357:70: note: candidate is: In file included from ../src/main.cpp:2:0: /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: static v8::Localv8::Integer v8::Integer::New(v8::Isolate, int32t) static Local New(Isolate isolate, int32t value); ^ /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: candidate expects 2 arguments, 1 provided ../src/main.cpp:360:25: error: no matching function for call to 'v8::Integer::New(int&)' return Integer::New(ret); ^ ../src/main.cpp:360:25: note: candidate is: In file included from ../src/main.cpp:2:0: /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: static v8::Localv8::Integer v8::Integer::New(v8::Isolate, int32t) static Local New(Isolate isolate, int32_t value); ^ /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: candidate expects 2 arguments, 1 provided ../src/main.cpp: At global scope: ../src/main.cpp:365:34: error: 'Arguments' does not name a type Handle js_write_bit(const Arguments& args) { ^ ../src/main.cpp: In function 'v8::Handlev8::Value js_write_bit(const int&)': ../src/main.cpp:366:42: error: 'Unwrap' is not a member of 'v8::External' modbus_t _ctx = static_cast<modbus_t >(External::Unwrap(args[0])); ^ ../src/main.cpp:366:65: error: invalid types 'const int[int]' for array subscript modbus_t ctx = static_cast<modbus_t >(External::Unwrap(args[0])); ^ ../src/main.cpp:367:40: error: invalid types 'const int[int]' for array subscript int addr = Local::Cast(args[1])->Int32Value(); ^ ../src/main.cpp:368:42: error: invalid types 'const int[int]' for array subscript int status = Local::Cast(args[2])->Int32Value(); ^ ../src/main.cpp:372:25: error: no matching function for call to 'v8::Integer::New(int&)' return Integer::New(ret); ^ ../src/main.cpp:372:25: note: candidate is: In file included from ../src/main.cpp:2:0: /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: static v8::Localv8::Integer v8::Integer::New(v8::Isolate_, int32_t) static Local New(Isolate* isolate, int32_t value); ^ /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: candidate expects 2 arguments, 1 provided ../src/main.cpp: At global scope: ../src/main.cpp:377:39: error: 'Arguments' does not name a type Handle js_write_register(const Arguments& args) { ^ ../src/main.cpp: In function 'v8::Handlev8::Value js_write_register(const int&)': ../src/main.cpp:378:42: error: 'Unwrap' is not a member of 'v8::External' modbus_t _ctx = static_cast<modbus_t >(External::Unwrap(args[0])); ^ ../src/main.cpp:378:65: error: invalid types 'const int[int]' for array subscript modbus_t ctx = static_cast<modbust *>(External::Unwrap(args[0])); ^ ../src/main.cpp:379:40: error: invalid types 'const int[int]' for array subscript int addr = Local::Cast(args[1])->Int32Value(); ^ ../src/main.cpp:380:41: error: invalid types 'const int[int]' for array subscript int value = Local::Cast(args[2])->Int32Value(); ^ ../src/main.cpp:384:25: error: no matching function for call to 'v8::Integer::New(int&)' return Integer::New(ret); ^ ../src/main.cpp:384:25: note: candidate is: In file included from ../src/main.cpp:2:0: /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: static v8::Localv8::Integer v8::Integer::New(v8::Isolate, int32_t) static Local New(Isolate* isolate, int32_t value); ^ /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: candidate expects 2 arguments, 1 provided ../src/main.cpp: At global scope: ../src/main.cpp:389:35: error: 'Arguments' does not name a type Handle js_write_bits(const Arguments& args) { ^ ../src/main.cpp: In function 'v8::Handlev8::Value js_write_bits(const int&)': ../src/main.cpp:390:42: error: 'Unwrap' is not a member of 'v8::External' modbus_t _ctx = static_cast<modbus_t >(External::Unwrap(args[0])); ^ ../src/main.cpp:390:65: error: invalid types 'const int[int]' for array subscript modbus_t ctx = static_cast<modbus_t >(External::Unwrap(args[0])); ^ ../src/main.cpp:391:40: error: invalid types 'const int[int]' for array subscript int addr = Local::Cast(args[1])->Int32Value(); ^ ../src/main.cpp:392:38: error: invalid types 'const int[int]' for array subscript int nb = Local::Cast(args[2])->Int32Value(); ^ ../src/main.cpp:393:50: error: invalid types 'const int[int]' for array subscript Local srcarr = Local::Cast(args[3]); ^ ../src/main.cpp:400:25: error: no matching function for call to 'v8::Integer::New(int&)' return Integer::New(ret); ^ ../src/main.cpp:400:25: note: candidate is: In file included from ../src/main.cpp:2:0: /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: static v8::Localv8::Integer v8::Integer::New(v8::Isolate, int32_t) static Local New(Isolate* isolate, int32_t value); ^ /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: candidate expects 2 arguments, 1 provided ../src/main.cpp: At global scope: ../src/main.cpp:405:40: error: 'Arguments' does not name a type Handle js_write_registers(const Arguments& args) { ^ ../src/main.cpp: In function 'v8::Handlev8::Value js_write_registers(const int&)': ../src/main.cpp:406:42: error: 'Unwrap' is not a member of 'v8::External' modbus_t _ctx = static_cast<modbus_t >(External::Unwrap(args[0])); ^ ../src/main.cpp:406:65: error: invalid types 'const int[int]' for array subscript modbus_t ctx = static_cast<modbus_t >(External::Unwrap(args[0])); ^ ../src/main.cpp:407:40: error: invalid types 'const int[int]' for array subscript int addr = Local::Cast(args[1])->Int32Value(); ^ ../src/main.cpp:408:38: error: invalid types 'const int[int]' for array subscript int nb = Local::Cast(args[2])->Int32Value(); ^ ../src/main.cpp:409:50: error: invalid types 'const int[int]' for array subscript Local srcarr = Local::Cast(args[3]); ^ ../src/main.cpp:416:25: error: no matching function for call to 'v8::Integer::New(int&)' return Integer::New(ret); ^ ../src/main.cpp:416:25: note: candidate is: In file included from ../src/main.cpp:2:0: /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: static v8::Localv8::Integer v8::Integer::New(v8::Isolate, int32_t) static Local New(Isolate* isolate, int32_t value); ^ /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: candidate expects 2 arguments, 1 provided ../src/main.cpp: At global scope: ../src/main.cpp:421:49: error: 'Arguments' does not name a type Handle js_write_and_read_registers(const Arguments& args) { ^ ../src/main.cpp: In function 'v8::Handlev8::Value js_write_and_read_registers(const int&)': ../src/main.cpp:422:42: error: 'Unwrap' is not a member of 'v8::External' modbus_t _ctx = static_cast<modbus_t >(External::Unwrap(args[0])); ^ ../src/main.cpp:422:65: error: invalid types 'const int[int]' for array subscript modbus_t ctx = static_cast<modbus_t >(External::Unwrap(args[0])); ^ ../src/main.cpp:423:46: error: invalid types 'const int[int]' for array subscript int write_addr = Local::Cast(args[1])->Int32Value(); ^ ../src/main.cpp:424:44: error: invalid types 'const int[int]' for array subscript int write_nb = Local::Cast(args[2])->Int32Value(); ^ ../src/main.cpp:425:50: error: invalid types 'const int[int]' for array subscript Local src_arr = Local::Cast(args[3]); ^ ../src/main.cpp:426:45: error: invalid types 'const int[int]' for array subscript int read_addr = Local::Cast(args[4])->Int32Value(); ^ ../src/main.cpp:427:43: error: invalid types 'const int[int]' for array subscript int read_nb = Local::Cast(args[5])->Int32Value(); ^ ../src/main.cpp:428:51: error: invalid types 'const int[int]' for array subscript Local dest_arr = Local::Cast(args[6]); ^ ../src/main.cpp:439:72: error: no matching function for call to 'v8::Number::New(uint16_t&)' for (int i = 0; i < read_nb; i++) destarr->Set(i, Number::New(dest[i])); ^ ../src/main.cpp:439:72: note: candidate is: In file included from ../src/main.cpp:2:0: /root/.node-gyp/0.12.4/deps/v8/include/v8.h:1999:24: note: static v8::Localv8::Number v8::Number::New(v8::Isolate, double) static Local New(Isolate* isolate, double value); ^ /root/.node-gyp/0.12.4/deps/v8/include/v8.h:1999:24: note: candidate expects 2 arguments, 1 provided ../src/main.cpp:441:25: error: no matching function for call to 'v8::Integer::New(int&)' return Integer::New(ret); ^ ../src/main.cpp:441:25: note: candidate is: In file included from ../src/main.cpp:2:0: /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: static v8::Localv8::Integer v8::Integer::New(v8::Isolate_, int32t) static Local New(Isolate isolate, int32_t value); ^ /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: candidate expects 2 arguments, 1 provided ../src/main.cpp: At global scope: ../src/main.cpp:446:41: error: 'Arguments' does not name a type Handle js_send_raw_request(const Arguments& args) { ^ ../src/main.cpp: In function 'v8::Handlev8::Value js_send_raw_request(const int&)': ../src/main.cpp:447:42: error: 'Unwrap' is not a member of 'v8::External' modbus_t _ctx = static_cast<modbus_t >(External::Unwrap(args[0])); ^ ../src/main.cpp:447:65: error: invalid types 'const int[int]' for array subscript modbus_t ctx = static_cast<modbus_t >(External::Unwrap(args[0])); ^ ../src/main.cpp:448:54: error: invalid types 'const int[int]' for array subscript Local raw_req_arr = Local::Cast(args[1]); ^ ../src/main.cpp:449:50: error: invalid types 'const int[int]' for array subscript int raw_reqlength = Local::Cast(args[2])->Int32Value(); ^ ../src/main.cpp:456:25: error: no matching function for call to 'v8::Integer::New(int&)' return Integer::New(ret); ^ ../src/main.cpp:456:25: note: candidate is: In file included from ../src/main.cpp:2:0: /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: static v8::Localv8::Integer v8::Integer::New(v8::Isolate, int32_t) static Local New(Isolate* isolate, int32_t value); ^ /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: candidate expects 2 arguments, 1 provided ../src/main.cpp: At global scope: ../src/main.cpp:461:45: error: 'Arguments' does not name a type Handle js_receive_confirmation(const Arguments& args) { ^ ../src/main.cpp: In function 'v8::Handlev8::Value js_receive_confirmation(const int&)': ../src/main.cpp:462:42: error: 'Unwrap' is not a member of 'v8::External' modbus_t _ctx = static_cast<modbus_t >(External::Unwrap(args[0])); ^ ../src/main.cpp:462:65: error: invalid types 'const int[int]' for array subscript modbus_t ctx = static_cast<modbus_t >(External::Unwrap(args[0])); ^ ../src/main.cpp:463:50: error: invalid types 'const int[int]' for array subscript Local rsp_arr = Local::Cast(args[1]); ^ ../src/main.cpp:471:67: error: no matching function for call to 'v8::Number::New(uint8_t&)' for (int i = 0; i < ret; i++) rsparr->Set(i, Number::New(rsp[i])); ^ ../src/main.cpp:471:67: note: candidate is: In file included from ../src/main.cpp:2:0: /root/.node-gyp/0.12.4/deps/v8/include/v8.h:1999:24: note: static v8::Localv8::Number v8::Number::New(v8::Isolate, double) static Local New(Isolate* isolate, double value); ^ /root/.node-gyp/0.12.4/deps/v8/include/v8.h:1999:24: note: candidate expects 2 arguments, 1 provided ../src/main.cpp:474:25: error: no matching function for call to 'v8::Integer::New(int&)' return Integer::New(ret); ^ ../src/main.cpp:474:25: note: candidate is: In file included from ../src/main.cpp:2:0: /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: static v8::Localv8::Integer v8::Integer::New(v8::Isolate_, int32t) static Local New(Isolate isolate, int32_t value); ^ /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: candidate expects 2 arguments, 1 provided ../src/main.cpp: At global scope: ../src/main.cpp:479:40: error: 'Arguments' does not name a type Handle js_reply_exception(const Arguments& args) { ^ ../src/main.cpp: In function 'v8::Handlev8::Value js_reply_exception(const int&)': ../src/main.cpp:480:42: error: 'Unwrap' is not a member of 'v8::External' modbus_t _ctx = static_cast<modbus_t >(External::Unwrap(args[0])); ^ ../src/main.cpp:480:65: error: invalid types 'const int[int]' for array subscript modbus_t ctx = static_cast<modbus_t >(External::Unwrap(args[0])); ^ ../src/main.cpp:481:50: error: invalid types 'const int[int]' for array subscript Local req_arr = Local::Cast(args[1]); ^ ../src/main.cpp:482:59: error: invalid types 'const int[int]' for array subscript unsigned int exceptioncode = Local::Cast(args[2])->Int32Value(); ^ ../src/main.cpp:490:25: error: no matching function for call to 'v8::Integer::New(int&)' return Integer::New(ret); ^ ../src/main.cpp:490:25: note: candidate is: In file included from ../src/main.cpp:2:0: /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: static v8::Localv8::Integer v8::Integer::New(v8::Isolate, int32_t) static Local New(Isolate* isolate, int32_t value); ^ /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: candidate expects 2 arguments, 1 provided ../src/main.cpp: At global scope: ../src/main.cpp:495:36: error: 'Arguments' does not name a type Handle js_mapping_new(const Arguments& args) { ^ ../src/main.cpp: In function 'v8::Handlev8::Value js_mapping_new(const int&)': ../src/main.cpp:496:43: error: invalid types 'const int[int]' for array subscript int nb_bits = Local::Cast(args[0])->Int32Value(); ^ ../src/main.cpp:497:49: error: invalid types 'const int[int]' for array subscript int nb_input_bits = Local::Cast(args[1])->Int32Value(); ^ ../src/main.cpp:498:48: error: invalid types 'const int[int]' for array subscript int nb_registers = Local::Cast(args[2])->Int32Value(); ^ ../src/main.cpp:499:54: error: invalid types 'const int[int]' for array subscript int nb_inputregisters = Local::Cast(args[3])->Int32Value(); ^ ../src/main.cpp:503:31: error: too few arguments to function 'v8::Handlev8::Primitive v8::Null(v8::Isolate)' if (map == NULL) return Null(); ^ In file included from ../src/main.cpp:2:0: /root/.node-gyp/0.12.4/deps/v8/include/v8.h:306:28: note: declared here friend Handle Null(Isolate_ isolate); ^ ../src/main.cpp:505:9: error: 'Wrap' is not a member of 'v8::External' return External::Wrap(map); ^ ../src/main.cpp: At global scope: ../src/main.cpp:510:37: error: 'Arguments' does not name a type Handle js_mapping_free(const Arguments& args) { ^ ../src/main.cpp: In function 'v8::Handlev8::Value js_mapping_free(const int&)': ../src/main.cpp:511:58: error: 'Unwrap' is not a member of 'v8::External' modbus_mapping_t _map = static_cast<modbus_mapping_t >(External::Unwrap(args[0])); ^ ../src/main.cpp:511:81: error: invalid types 'const int[int]' for array subscript modbus_mapping_t map = static_cast<modbus_mappingt *>(External::Unwrap(args[0])); ^ ../src/main.cpp:515:19: error: too few arguments to function 'v8::Handlev8::Primitive v8::Undefined(v8::Isolate)' return Undefined(); ^ In file included from ../src/main.cpp:2:0: /root/.node-gyp/0.12.4/deps/v8/include/v8.h:305:28: note: declared here friend Handle Undefined(Isolate* isolate); ^ ../src/main.cpp: At global scope: ../src/main.cpp:520:32: error: 'Arguments' does not name a type Handle js_receive(const Arguments& args) { ^ ../src/main.cpp: In function 'v8::Handlev8::Value js_receive(const int&)': ../src/main.cpp:521:42: error: 'Unwrap' is not a member of 'v8::External' modbus_t _ctx = static_cast<modbus_t >(External::Unwrap(args[0])); ^ ../src/main.cpp:521:65: error: invalid types 'const int[int]' for array subscript modbus_t ctx = static_cast<modbus_t >(External::Unwrap(args[0])); ^ ../src/main.cpp:522:50: error: invalid types 'const int[int]' for array subscript Local req_arr = Local::Cast(args[1]); ^ ../src/main.cpp:530:67: error: no matching function for call to 'v8::Number::New(uint8_t&)' for (int i = 0; i < ret; i++) reqarr->Set(i, Number::New(req[i])); ^ ../src/main.cpp:530:67: note: candidate is: In file included from ../src/main.cpp:2:0: /root/.node-gyp/0.12.4/deps/v8/include/v8.h:1999:24: note: static v8::Localv8::Number v8::Number::New(v8::Isolate, double) static Local New(Isolate* isolate, double value); ^ /root/.node-gyp/0.12.4/deps/v8/include/v8.h:1999:24: note: candidate expects 2 arguments, 1 provided ../src/main.cpp:533:25: error: no matching function for call to 'v8::Integer::New(int&)' return Integer::New(ret); ^ ../src/main.cpp:533:25: note: candidate is: In file included from ../src/main.cpp:2:0: /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: static v8::Localv8::Integer v8::Integer::New(v8::Isolate_, int32t) static Local New(Isolate isolate, int32_t value); ^ /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: candidate expects 2 arguments, 1 provided ../src/main.cpp: At global scope: ../src/main.cpp:538:30: error: 'Arguments' does not name a type Handle js_reply(const Arguments& args) { ^ ../src/main.cpp: In function 'v8::Handlev8::Value js_reply(const int&)': ../src/main.cpp:539:42: error: 'Unwrap' is not a member of 'v8::External' modbus_t _ctx = static_cast<modbus_t >(External::Unwrap(args[0])); ^ ../src/main.cpp:539:65: error: invalid types 'const int[int]' for array subscript modbus_t ctx = static_cast<modbus_t >(External::Unwrap(args[0])); ^ ../src/main.cpp:540:50: error: invalid types 'const int[int]' for array subscript Local req_arr = Local::Cast(args[1]); ^ ../src/main.cpp:541:46: error: invalid types 'const int[int]' for array subscript int req_length = Local::Cast(args[2])->Int32Value(); ^ ../src/main.cpp:542:65: error: 'Unwrap' is not a member of 'v8::External' modbus_mapping_t mb_mapping = static_cast<modbus_mapping_t >(External::Unwrap(args[3])); ^ ../src/main.cpp:542:88: error: invalid types 'const int[int]' for array subscript modbus_mapping_t mb_mapping = static_cast<modbus_mapping_t >(External::Unwrap(args[3])); ^ ../src/main.cpp:549:25: error: no matching function for call to 'v8::Integer::New(int&)' return Integer::New(ret); ^ ../src/main.cpp:549:25: note: candidate is: In file included from ../src/main.cpp:2:0: /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: static v8::Localv8::Integer v8::Integer::New(v8::Isolate_, int32_t) static Local New(Isolate* isolate, int32_t value); ^ /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: candidate expects 2 arguments, 1 provided ../src/main.cpp: At global scope: ../src/main.cpp:554:33: error: 'Arguments' does not name a type Handle js_strerror(const Arguments& args) { ^ ../src/main.cpp: In function 'v8::Handlev8::Value js_strerror(const int&)': ../src/main.cpp:557:9: error: 'New' is not a member of 'v8::String' return String::New(ret); ^ ../src/main.cpp: At global scope: ../src/main.cpp:562:35: error: 'Arguments' does not name a type Handle js_tcp_listen(const Arguments& args) { ^ ../src/main.cpp: In function 'v8::Handlev8::Value js_tcp_listen(const int&)': ../src/main.cpp:563:42: error: 'Unwrap' is not a member of 'v8::External' modbus_t _ctx = static_cast<modbus_t >(External::Unwrap(args[0])); ^ ../src/main.cpp:563:65: error: invalid types 'const int[int]' for array subscript modbus_t ctx = static_cast<modbus_t >(External::Unwrap(args[0])); ^ ../src/main.cpp:564:49: error: invalid types 'const int[int]' for array subscript int nbconnection = Local::Cast(args[1])->Int32Value(); ^ ../src/main.cpp:568:25: error: no matching function for call to 'v8::Integer::New(int&)' return Integer::New(ret); ^ ../src/main.cpp:568:25: note: candidate is: In file included from ../src/main.cpp:2:0: /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: static v8::Localv8::Integer v8::Integer::New(v8::Isolate, int32_t) static Local New(Isolate* isolate, int32_t value); ^ /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: candidate expects 2 arguments, 1 provided ../src/main.cpp: At global scope: ../src/main.cpp:573:35: error: 'Arguments' does not name a type Handle js_tcp_accept(const Arguments& args) { ^ ../src/main.cpp: In function 'v8::Handlev8::Value js_tcp_accept(const int&)': ../src/main.cpp:574:42: error: 'Unwrap' is not a member of 'v8::External' modbus_t _ctx = static_cast<modbus_t >(External::Unwrap(args[0])); ^ ../src/main.cpp:574:65: error: invalid types 'const int[int]' for array subscript modbus_t ctx = static_cast<modbus_t >(External::Unwrap(args[0])); ^ ../src/main.cpp:575:42: error: invalid types 'const int[int]' for array subscript int socket = Local::Cast(args[1])->Int32Value(); ^ ../src/main.cpp:579:25: error: no matching function for call to 'v8::Integer::New(int&)' return Integer::New(ret); ^ ../src/main.cpp:579:25: note: candidate is: In file included from ../src/main.cpp:2:0: /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: static v8::Localv8::Integer v8::Integer::New(v8::Isolate_, int32_t) static Local New(Isolate* isolate, int32_t value); ^ /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: candidate expects 2 arguments, 1 provided ../src/main.cpp: At global scope: ../src/main.cpp:584:38: error: 'Arguments' does not name a type Handle js_tcp_pi_listen(const Arguments& args) { ^ ../src/main.cpp: In function 'v8::Handlev8::Value js_tcp_pi_listen(const int&)': ../src/main.cpp:585:42: error: 'Unwrap' is not a member of 'v8::External' modbus_t _ctx = static_cast<modbus_t >(External::Unwrap(args[0])); ^ ../src/main.cpp:585:65: error: invalid types 'const int[int]' for array subscript modbus_t ctx = static_cast<modbus_t >(External::Unwrap(args[0])); ^ ../src/main.cpp:586:49: error: invalid types 'const int[int]' for array subscript int nbconnection = Local::Cast(args[1])->Int32Value(); ^ ../src/main.cpp:590:25: error: no matching function for call to 'v8::Integer::New(int&)' return Integer::New(ret); ^ ../src/main.cpp:590:25: note: candidate is: In file included from ../src/main.cpp:2:0: /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: static v8::Localv8::Integer v8::Integer::New(v8::Isolate, int32_t) static Local New(Isolate* isolate, int32_t value); ^ /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: candidate expects 2 arguments, 1 provided ../src/main.cpp: At global scope: ../src/main.cpp:595:38: error: 'Arguments' does not name a type Handle js_tcp_pi_accept(const Arguments& args) { ^ ../src/main.cpp: In function 'v8::Handlev8::Value js_tcp_pi_accept(const int&)': ../src/main.cpp:596:42: error: 'Unwrap' is not a member of 'v8::External' modbus_t _ctx = static_cast<modbus_t >(External::Unwrap(args[0])); ^ ../src/main.cpp:596:65: error: invalid types 'const int[int]' for array subscript modbus_t ctx = static_cast<modbus_t >(External::Unwrap(args[0])); ^ ../src/main.cpp:597:42: error: invalid types 'const int[int]' for array subscript int socket = Local::Cast(args[1])->Int32Value(); ^ ../src/main.cpp:601:25: error: no matching function for call to 'v8::Integer::New(int&)' return Integer::New(ret); ^ ../src/main.cpp:601:25: note: candidate is: In file included from ../src/main.cpp:2:0: /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: static v8::Localv8::Integer v8::Integer::New(v8::Isolate_, int32_t) static Local New(Isolate* isolate, int32_t value); ^ /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: candidate expects 2 arguments, 1 provided ../src/main.cpp: At global scope: ../src/main.cpp:606:33: error: 'Arguments' does not name a type Handle map_to_json(const Arguments& args) { ^ ../src/main.cpp: In function 'v8::Handlev8::Value map_to_json(const int&)': ../src/main.cpp:607:58: error: 'Unwrap' is not a member of 'v8::External' modbus_mapping_t _map = static_cast<modbus_mapping_t >(External::Unwrap(args[0])); ^ ../src/main.cpp:607:81: error: invalid types 'const int[int]' for array subscript modbus_mapping_t map = static_cast<modbus_mapping_t *>(External::Unwrap(args[0])); ^ ../src/main.cpp:608:48: error: invalid types 'const int[int]' for array subscript Local jso = Local::Cast(args[1]); ^ ../src/main.cpp:610:11: error: 'New' is not a member of 'v8::String' jso->Set(String::New("nb_bits"), Integer::New(map->nb_bits)); ^ ../src/main.cpp:610:60: error: no matching function for call to 'v8::Integer::New(int&)' jso->Set(String::New("nb_bits"), Integer::New(map->nbbits)); ^ ../src/main.cpp:610:60: note: candidate is: In file included from ../src/main.cpp:2:0: /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: static v8::Localv8::Integer v8::Integer::New(v8::Isolate, int32_t) static Local New(Isolate* isolate, int32_t value); ^ /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: candidate expects 2 arguments, 1 provided ../src/main.cpp:611:11: error: 'New' is not a member of 'v8::String' jso->Set(String::New("nb_input_bits"), Integer::New(map->nb_input_bits)); ^ ../src/main.cpp:611:72: error: no matching function for call to 'v8::Integer::New(int&)' jso->Set(String::New("nb_input_bits"), Integer::New(map->nb_inputbits)); ^ ../src/main.cpp:611:72: note: candidate is: In file included from ../src/main.cpp:2:0: /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: static v8::Localv8::Integer v8::Integer::New(v8::Isolate, int32t) static Local New(Isolate isolate, int32_t value); ^ /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: candidate expects 2 arguments, 1 provided ../src/main.cpp:612:11: error: 'New' is not a member of 'v8::String' jso->Set(String::New("nb_input_registers"), Integer::New(map->nb_input_registers)); ^ ../src/main.cpp:612:82: error: no matching function for call to 'v8::Integer::New(int&)' jso->Set(String::New("nb_input_registers"), Integer::New(map->nb_inputregisters)); ^ ../src/main.cpp:612:82: note: candidate is: In file included from ../src/main.cpp:2:0: /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: static v8::Localv8::Integer v8::Integer::New(v8::Isolate, int32t) static Local New(Isolate isolate, int32_t value); ^ /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: candidate expects 2 arguments, 1 provided ../src/main.cpp:613:11: error: 'New' is not a member of 'v8::String' jso->Set(String::New("nb_registers"), Integer::New(map->nb_registers)); ^ ../src/main.cpp:613:70: error: no matching function for call to 'v8::Integer::New(int&)' jso->Set(String::New("nb_registers"), Integer::New(map->nbregisters)); ^ ../src/main.cpp:613:70: note: candidate is: In file included from ../src/main.cpp:2:0: /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: static v8::Localv8::Integer v8::Integer::New(v8::Isolate, int32t) static Local New(Isolate isolate, int32_t value); ^ /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: candidate expects 2 arguments, 1 provided ../src/main.cpp:615:37: error: no matching function for call to 'v8::Array::New()' Local tabbits = Array::New(); ^ ../src/main.cpp:615:37: note: candidate is: In file included from ../src/main.cpp:2:0: /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2417:23: note: static v8::Localv8::Array v8::Array::New(v8::Isolate, int) static Local New(Isolate_ isolate, int length = 0); ^ /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2417:23: note: candidate expects 2 arguments, 0 provided ../src/main.cpp:617:49: error: no matching function for call to 'v8::Integer::New(uint8_t&)' tab_bits->Set(i, Integer::New(map->tabbits[i])); ^ ../src/main.cpp:617:49: note: candidate is: In file included from ../src/main.cpp:2:0: /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: static v8::Localv8::Integer v8::Integer::New(v8::Isolate, int32t) static Local New(Isolate isolate, int32_t value); ^ /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: candidate expects 2 arguments, 1 provided ../src/main.cpp:620:43: error: no matching function for call to 'v8::Array::New()' Local tab_inputbits = Array::New(); ^ ../src/main.cpp:620:43: note: candidate is: In file included from ../src/main.cpp:2:0: /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2417:23: note: static v8::Localv8::Array v8::Array::New(v8::Isolate, int) static Local New(Isolate_ isolate, int length = 0); ^ /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2417:23: note: candidate expects 2 arguments, 0 provided ../src/main.cpp:622:61: error: no matching function for call to 'v8::Integer::New(uint8_t&)' tab_input_bits->Set(i, Integer::New(map->tab_inputbits[i])); ^ ../src/main.cpp:622:61: note: candidate is: In file included from ../src/main.cpp:2:0: /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: static v8::Localv8::Integer v8::Integer::New(v8::Isolate, int32t) static Local New(Isolate isolate, int32_t value); ^ /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: candidate expects 2 arguments, 1 provided ../src/main.cpp:625:48: error: no matching function for call to 'v8::Array::New()' Local tab_inputregisters = Array::New(); ^ ../src/main.cpp:625:48: note: candidate is: In file included from ../src/main.cpp:2:0: /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2417:23: note: static v8::Localv8::Array v8::Array::New(v8::Isolate, int) static Local New(Isolate_ isolate, int length = 0); ^ /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2417:23: note: candidate expects 2 arguments, 0 provided ../src/main.cpp:627:71: error: no matching function for call to 'v8::Integer::New(uint16_t&)' tab_input_registers->Set(i, Integer::New(map->tab_inputregisters[i])); ^ ../src/main.cpp:627:71: note: candidate is: In file included from ../src/main.cpp:2:0: /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: static v8::Localv8::Integer v8::Integer::New(v8::Isolate, int32t) static Local New(Isolate isolate, int32_t value); ^ /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: candidate expects 2 arguments, 1 provided ../src/main.cpp:630:42: error: no matching function for call to 'v8::Array::New()' Local tabregisters = Array::New(); ^ ../src/main.cpp:630:42: note: candidate is: In file included from ../src/main.cpp:2:0: /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2417:23: note: static v8::Localv8::Array v8::Array::New(v8::Isolate, int) static Local New(Isolate_ isolate, int length = 0); ^ /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2417:23: note: candidate expects 2 arguments, 0 provided ../src/main.cpp:632:59: error: no matching function for call to 'v8::Integer::New(uint16_t&)' tab_registers->Set(i, Integer::New(map->tabregisters[i])); ^ ../src/main.cpp:632:59: note: candidate is: In file included from ../src/main.cpp:2:0: /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: static v8::Localv8::Integer v8::Integer::New(v8::Isolate, int32t) static Local New(Isolate isolate, int32_t value); ^ /root/.node-gyp/0.12.4/deps/v8/include/v8.h:2012:25: note: candidate expects 2 arguments, 1 provided ../src/main.cpp:635:11: error: 'New' is not a member of 'v8::String' jso->Set(String::New("tab_bits"), tab_bits); ^ ../src/main.cpp:636:11: error: 'New' is not a member of 'v8::String' jso->Set(String::New("tab_input_bits"), tab_input_bits); ^ ../src/main.cpp:637:11: error: 'New' is not a member of 'v8::String' jso->Set(String::New("tab_input_registers"), tab_input_registers); ^ ../src/main.cpp:638:11: error: 'New' is not a member of 'v8::String' jso->Set(String::New("tab_registers"), tabregisters); ^ ../src/main.cpp:640:19: error: too few arguments to function 'v8::Handlev8::Primitive v8::Undefined(v8::Isolate)' return Undefined(); ^ In file included from ../src/main.cpp:2:0: /root/.node-gyp/0.12.4/deps/v8/include/v8.h:305:28: note: declared here friend Handle Undefined(Isolate_ isolate); ^ ../src/main.cpp: At global scope: ../src/main.cpp:645:33: error: 'Arguments' does not name a type Handle json_to_map(const Arguments& args) { ^ ../src/main.cpp: In function 'v8::Handlev8::Value json_to_map(const int&)': ../src/main.cpp:646:48: error: invalid types 'const int[int]' for array subscript Local jso = Local::Cast(args[0]); ^ ../src/main.cpp:647:58: error: 'Unwrap' is not a member of 'v8::External' modbus_mapping_t _map = static_cast<modbus_mapping_t >(External::Unwrap(args[1])); ^ ../src/main.cpp:647:81: error: invalid types 'const int[int]' for array subscript modbus_mapping_t map = static_cast<modbus_mapping_t >(External::Unwrap(args[1])); ^ ../src/main.cpp:649:26: error: 'New' is not a member of 'v8::String' map->nb_bits = jso->Get(String::New("nb_bits"))->Int32Value(); ^ ../src/main.cpp:650:32: error: 'New' is not a member of 'v8::String' map->nb_input_bits = jso->Get(String::New("nb_input_bits"))->Int32Value(); ^ ../src/main.cpp:651:37: error: 'New' is not a member of 'v8::String' map->nb_input_registers = jso->Get(String::New("nb_input_registers"))->Int32Value(); ^ ../src/main.cpp:652:31: error: 'New' is not a member of 'v8::String' map->nb_registers = jso->Get(String::New("nb_registers"))->Int32Value(); ^ ../src/main.cpp:654:54: error: 'New' is not a member of 'v8::String' Local tab_bits = Local::Cast(jso->Get(String::New("tab_bits"))); ^ ../src/main.cpp:659:60: error: 'New' is not a member of 'v8::String' Local tab_input_bits = Local::Cast(jso->Get(String::New("tab_input_bits"))); ^ ../src/main.cpp:664:65: error: 'New' is not a member of 'v8::String' Local tab_input_registers = Local::Cast(jso->Get(String::New("tab_input_registers"))); ^ ../src/main.cpp:669:59: error: 'New' is not a member of 'v8::String' Local tab_registers = Local::Cast(jso->Get(String::New("tabregisters"))); ^ ../src/main.cpp:674:19: error: too few arguments to function 'v8::Handlev8::Primitive v8::Undefined(v8::Isolate)' return Undefined(); ^ In file included from ../src/main.cpp:2:0: /root/.node-gyp/0.12.4/deps/v8/include/v8.h:305:28: note: declared here friend Handle Undefined(Isolate* isolate); ^ ../src/main.cpp: At global scope: ../src/main.cpp:684:19: error: variable or field 'tcp_accept_w' declared void void tcp_accept_w(uv_work_t* req) { ^ ../src/main.cpp:684:19: error: 'uv_work_t' was not declared in this scope ../src/main.cpp:684:30: error: 'req' was not declared in this scope void tcp_accept_w(uv_work_t* req) { ^ ../src/main.cpp:689:19: error: variable or field 'tcp_accept_a' declared void void tcp_accept_a(uv_work_t* req, int arg) { ^ ../src/main.cpp:689:19: error: 'uv_work_t' was not declared in this scope ../src/main.cpp:689:30: error: 'req' was not declared in this scope void tcp_accept_a(uv_work_t* req, int arg) { ^ ../src/main.cpp:689:35: error: expected primary-expression before 'int' void tcp_accept_a(uv_work_t* req, int arg) { ^ ../src/main.cpp:706:38: error: 'Arguments' does not name a type Handle tcp_accept_async(const Arguments& args) { ^ ../src/main.cpp: In function 'v8::Handlev8::Value tcp_accept_async(const int&)': ../src/main.cpp:707:42: error: 'Unwrap' is not a member of 'v8::External' modbus_t _ctx = static_cast<modbus_t >(External::Unwrap(args[0])); ^ ../src/main.cpp:707:65: error: invalid types 'const int[int]' for array subscript modbus_t ctx = static_cast<modbus_t >(External::Unwrap(args[0])); ^ ../src/main.cpp:708:42: error: invalid types 'const int[int]' for array subscript int socket = Local::Cast(args[1])->Int32Value(); ^ ../src/main.cpp:709:51: error: invalid types 'const int[int]' for array subscript Local cb = Local::Cast(args[2]); ^ ../src/main.cpp:714:44: error: no matching function for call to 'v8::Persistentv8::Function::New(v8::Localv8::Function&)' request->cb = Persistent::New(cb); ^ ../src/main.cpp:714:44: note: candidate is: In file included from ../src/main.cpp:2:0: /root/.node-gyp/0.12.4/deps/v8/include/v8.h:5798:4: note: static T v8::PersistentBase::New(v8::Isolate, T_) [with T = v8::Function] T* PersistentBase::New(Isolate* isolate, T* that) { ^ /root/.node-gyp/0.12.4/deps/v8/include/v8.h:5798:4: note: candidate expects 2 arguments, 1 provided ../src/main.cpp:716:2: error: 'uv_work_t' was not declared in this scope uv_work_t* req = new uv_work_t(); ^ ../src/main.cpp:716:13: error: 'req' was not declared in this scope uv_work_t* req = new uv_work_t(); ^ ../src/main.cpp:716:23: error: expected type-specifier before 'uv_work_t' uv_work_t* req = new uv_work_t(); ^ ../src/main.cpp:719:32: error: 'uv_default_loop' was not declared in this scope uv_queue_work(uv_default_loop(), req, tcp_accept_w, tcp_accept_a); ^ ../src/main.cpp:719:40: error: 'tcp_accept_w' was not declared in this scope uv_queue_work(uv_default_loop(), req, tcp_accept_w, tcp_accept_a); ^ ../src/main.cpp:719:54: error: 'tcp_accept_a' was not declared in this scope uv_queue_work(uv_default_loop(), req, tcp_accept_w, tcp_accept_a); ^ ../src/main.cpp:719:66: error: 'uv_queue_work' was not declared in this scope uv_queue_work(uv_default_loop(), req, tcp_accept_w, tcp_accepta); ^ ../src/main.cpp:721:19: error: too few arguments to function 'v8::Handlev8::Primitive v8::Undefined(v8::Isolate)' return Undefined(); ^ In file included from ../src/main.cpp:2:0: /root/.node-gyp/0.12.4/deps/v8/include/v8.h:305:28: note: declared here friend Handle Undefined(Isolate_ isolate); ^ ../src/main.cpp: At global scope: ../src/main.cpp:731:16: error: variable or field 'receive_w' declared void void receive_w(uv_work_t* req) { ^ ../src/main.cpp:731:16: error: 'uv_work_t' was not declared in this scope ../src/main.cpp:731:27: error: 'req' was not declared in this scope void receive_w(uv_work_t* req) { ^ ../src/main.cpp:736:16: error: variable or field 'receive_a' declared void void receive_a(uv_work_t* req, int arg) { ^ ../src/main.cpp:736:16: error: 'uv_work_t' was not declared in this scope ../src/main.cpp:736:27: error: 'req' was not declared in this scope void receive_a(uv_work_t* req, int arg) { ^ ../src/main.cpp:736:32: error: expected primary-expression before 'int' void receive_a(uv_work_t* req, int arg) { ^ ../src/main.cpp: In function 'v8::Handlev8::Value js_new_rtu(const int&)': ../src/main.cpp:36:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ ../src/main.cpp: In function 'v8::Handlev8::Value js_rtu_get_serial_mode(const int&)': ../src/main.cpp:46:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ ../src/main.cpp: In function 'v8::Handlev8::Value js_rtu_set_serial_mode(const int&)': ../src/main.cpp:57:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ ../src/main.cpp: In function 'v8::Handlev8::Value js_new_tcp(const int&)': ../src/main.cpp:91:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ ../src/main.cpp: In function 'v8::Handlev8::Value js_new_tcp_pi(const int&)': ../src/main.cpp:104:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ ../src/main.cpp: In function 'v8::Handlev8::Value js_free(const int&)': ../src/main.cpp:114:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ ../src/main.cpp: In function 'v8::Handlev8::Value js_get_byte_timeout(const int&)': ../src/main.cpp:131:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ ../src/main.cpp: In function 'v8::Handlev8::Value js_set_byte_timeout(const int&)': ../src/main.cpp:145:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ ../src/main.cpp: In function 'v8::Handlev8::Value js_set_debug(const int&)': ../src/main.cpp:156:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ ../src/main.cpp: In function 'v8::Handlev8::Value js_set_error_recovery(const int&)': ../src/main.cpp:167:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ ../src/main.cpp: In function 'v8::Handlev8::Value js_get_header_length(const int&)': ../src/main.cpp:177:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ ../src/main.cpp: In function 'v8::Handlev8::Value js_get_response_timeout(const int&)': ../src/main.cpp:194:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ ../src/main.cpp: In function 'v8::Handlev8::Value js_set_response_timeout(const int&)': ../src/main.cpp:208:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ ../src/main.cpp: In function 'v8::Handlev8::Value js_set_slave(const int&)': ../src/main.cpp:219:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ ../src/main.cpp: In function 'v8::Handlev8::Value js_set_socket(const int&)': ../src/main.cpp:230:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ ../src/main.cpp: In function 'v8::Handlev8::Value js_get_socket(const int&)': ../src/main.cpp:240:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ ../src/main.cpp: In function 'v8::Handlev8::Value js_connect(const int&)': ../src/main.cpp:257:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ ../src/main.cpp: In function 'v8::Handlev8::Value js_close(const int&)': ../src/main.cpp:267:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ ../src/main.cpp: In function 'v8::Handlev8::Value js_flush(const int&)': ../src/main.cpp:277:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ ../src/main.cpp: In function 'v8::Handlev8::Value js_read_bits(const int&)': ../src/main.cpp:293:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ ../src/main.cpp: In function 'v8::Handlev8::Value js_read_input_bits(const int&)': ../src/main.cpp:309:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ ../src/main.cpp: In function 'v8::Handlev8::Value js_read_registers(const int&)': ../src/main.cpp:325:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ ../src/main.cpp: In function 'v8::Handlev8::Value js_read_input_registers(const int&)': ../src/main.cpp:341:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ ../src/main.cpp: In function 'v8::Handlev8::Value js_report_slave_id(const int&)': ../src/main.cpp:361:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ ../src/main.cpp: In function 'v8::Handlev8::Value js_write_bit(const int&)': ../src/main.cpp:373:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ ../src/main.cpp: In function 'v8::Handlev8::Value js_write_register(const int&)': ../src/main.cpp:385:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ ../src/main.cpp: In function 'v8::Handlev8::Value js_write_bits(const int&)': ../src/main.cpp:401:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ ../src/main.cpp: In function 'v8::Handlev8::Value js_write_registers(const int&)': ../src/main.cpp:417:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ ../src/main.cpp: In function 'v8::Handlev8::Value js_write_and_read_registers(const int&)': ../src/main.cpp:442:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ ../src/main.cpp: In function 'v8::Handlev8::Value js_send_raw_request(const int&)': ../src/main.cpp:457:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ ../src/main.cpp: In function 'v8::Handlev8::Value js_receive_confirmation(const int&)': ../src/main.cpp:475:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ ../src/main.cpp: In function 'v8::Handlev8::Value js_reply_exception(const int&)': ../src/main.cpp:491:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ ../src/main.cpp: In function 'v8::Handlev8::Value js_mapping_new(const int&)': ../src/main.cpp:506:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ ../src/main.cpp: In function 'v8::Handlev8::Value js_mapping_free(const int&)': ../src/main.cpp:516:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ ../src/main.cpp: In function 'v8::Handlev8::Value js_receive(const int&)': ../src/main.cpp:534:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ ../src/main.cpp: In function 'v8::Handlev8::Value js_reply(const int&)': ../src/main.cpp:550:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ ../src/main.cpp: In function 'v8::Handlev8::Value js_strerror(const int&)': ../src/main.cpp:558:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ ../src/main.cpp: In function 'v8::Handlev8::Value js_tcp_listen(const int&)': ../src/main.cpp:569:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ ../src/main.cpp: In function 'v8::Handlev8::Value js_tcp_accept(const int&)': ../src/main.cpp:580:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ ../src/main.cpp: In function 'v8::Handlev8::Value js_tcp_pi_listen(const int&)': ../src/main.cpp:591:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ ../src/main.cpp: In function 'v8::Handlev8::Value js_tcp_pi_accept(const int&)': ../src/main.cpp:602:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ ../src/main.cpp: In function 'v8::Handlev8::Value map_to_json(const int&)': ../src/main.cpp:641:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ ../src/main.cpp: In function 'v8::Handlev8::Value json_to_map(const int&)': ../src/main.cpp:675:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ ../src/main.cpp: In function 'v8::Handlev8::Value tcp_accept_async(const int&)': ../src/main.cpp:722:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ modbus_binding.target.mk:87: recipe for target 'Release/obj.target/modbus_binding/src/main.o' failed make: *\ [Release/obj.target/modbus_binding/src/main.o] Error 1 make: Leaving directory '/root/test/nodejs_libmodbus/build' gyp ERR! build error gyp ERR! stack Error: make failed with exit code: 2 gyp ERR! stack at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:269:23) gyp ERR! stack at ChildProcess.emit (events.js:110:17) gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:1074:12) gyp ERR! System Linux 3.18.14-2-ARCH gyp ERR! command "node" "/usr/bin/node-gyp" "build" gyp ERR! cwd /root/test/nodejs_libmodbus gyp ERR! node -v v0.12.4 gyp ERR! node-gyp -v v2.0.1 gyp ERR! not ok

scsirdx commented 9 years ago

Same error.

jeremypoulter commented 9 years ago

Yes, looks like this module only supports node.js < 0.11. Unfortunately looks like there are major changes to the node.js (V8) internal APIs between 0.10 and 0.12.

jkeiter commented 9 years ago

I have the following using armhf and compiling on a RPI 1 with latest updated raspbian for the first function in main.cpp Handle js_new_rtu(const Arguments& args) { ..

gyp info it worked if it ends with ok gyp info using node-gyp@2.0.2 gyp info using node@0.12.6 | linux | arm gyp info spawn make gyp info make: Entering directory '/home/pi/nodeLibmodbus-master/build' spawn args [ 'BUILDTYPE=Release', '-C', 'build' ] CXX(target) Release/obj.target/modbus_binding/src/main.o ../src/main.cpp:24:32: error: ‘Arguments’ does not name a type ../src/main.cpp:24:43: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive] ../src/main.cpp: In function ‘v8::Handlev8::Value js_new_rtu(const int&)’: ../src/main.cpp:25:33: error: invalid types ‘const int[int]’ for array subscript ../src/main.cpp:26:40: error: invalid types ‘const int[int]’ for array subscript ../src/main.cpp:27:37: error: invalid types ‘const int[int]’ for array subscript ../src/main.cpp:28:44: error: invalid types ‘const int[int]’ for array subscript ../src/main.cpp:29:44: error: invalid types ‘const int[int]’ for array subscript ../src/main.cpp:35:31: error: too few arguments to function ‘v8::Handlev8::Primitive v8::Null(v8::Isolate*)’ /home/pi/.node-gyp/0.12.6/deps/v8/include/v8.h:306:28: note: declared here ../src/main.cpp:37:9: error: ‘Wrap’ is not a member of ‘v8::External’ ../src/main.cpp: At global scope: ../src/main.cpp:42:44: error: ‘Arguments’ does not name a type // and so on ..

I dont have a lot of experience in c++ debug but the Arguments type error seems to be the first issue.. maybe a compiler switch? Perhaps the compiler update is the issue and not V8. Thanks

jeremypoulter commented 9 years ago

Sorry, not a compiler issue this is a well known issue with Node 0.12.

Probably the best way forward is to port to use

jeremypoulter commented 9 years ago

Oops wrong button...

https://github.com/nodejs/nan

I am going to try and look at this so if anyone wants to help or has already started let me know

jkeiter commented 9 years ago

Ok it is not a compiler issue.. Seems looking at the node JS 0.12 addon page that this driver needs a substantial rewrite.. for instance I can't find an example for returning the CTX structure if based on the existing code: Handle js_new_rtu(const FunctionCallbackInfo& args) { Isolate* isolate = Isolate::GetCurrent(); HandleScope scope(isolate); // I find examples showing for instance : void js_new_rtu(const FunctionCallbackInfo& args) { Isolate* isolate = Isolate::GetCurrent(); HandleScope scope(isolate); // so the CTX structure has to be wrapped in the isolate object..?? or the node_object_wrap class object.. i.e. MyObject* obj = new MyObject(value); obj->Wrap(args.This()); args.GetReturnValue().Set(args.This());

So I'm thinking the biggest hurdle for me right now is to wrap the ctx object and unwrap it in the correct way using void ####(const FunctionCallbackInfo& args)

I was looking at https://github.com/nodejs/node-addon-examples
8_passing_wrapped/node_0.12

PaulCharlton commented 8 years ago
jkeiter commented 8 years ago

OK I am happy to see this contribution; On an PI 2 I had no issues when compiling other than the same issues I had before .. ( modbus version and response timeout which I commented out ) however on execution my node test js program I get: FATAL ERROR: v8::HandleScope::CreateHandle() Cannot create a handle without a HandleScope Aborted

FYI node -v v5.4.1 npm -v 3.5.3 node-gyp -v v3.2.1

On Sat, Jan 23, 2016 at 2:56 AM, Paul Charlton notifications@github.com wrote:

see ecb970e https://github.com/tuxnsk/nodejs_libmodbus/commit/ecb970eb36dd6017269fd6432efb83e882ad83d6

it is a port to the new node native API

— Reply to this email directly or view it on GitHub https://github.com/tuxnsk/nodejs_libmodbus/issues/22#issuecomment-174171391 .

Joe Keiter C: 951-723-7167 W: 949-648-2742 H: 951-679-3050 jlkeiter@gmail.com j.keiter@controlco.com