I have some nodes. I am trying to create Js addons. Inside the Aadian I have a call for a static lib. I compile everything, but when I call my addon function from javascript, I get the following:
module .js: 356 module._A extensions [extension] (this, file name); ^ Error: /home/.../Projects/NodeAddonComLibTest/build/Debug/addon.node: Undefined Icons: _Z6ctest1Pi on module.load (module.js: 356: 32) function. Module._load (module.js: 312: 12) on the requirement of module.quare (module .js: 364: 17) (module .js: 380: 17) on the object. & Lt; Anonymous & gt; (/home/.../Projects/NodeAddonComLibTest/doTest.js:1:75) at Module._compile (module.js: 456: 26) at Object.Module._extensions..js (module.js: 474: 10) )) On module.load (module.js: 356: 32) function. Function on module._load (module.js: 312: 12) Module.Rannman (Module Js: 497: 10) My addion code is as follows:
#include & lt; Iostream & gt; #include & lt; String.h & gt; # Include & lt; Stdlib.h & gt; # Include & lt; Node.h & gt; # Include & lt; V8.h & gt; Using the name space v8; using namespace std; Zero ctest1 (int *); Handle & lt; Price & gt; Set Port (Constant Arggras & Eggs) {Handlescope Scope; If (args.Length ()! = 1) {ThrowException (Exception :: Type Error (String :: New ("Wrong number of Logic."))); Return zone Close (undefined ()); } // ======================== printf ("Calling Static Lib ... \ n"); Int x = 0; Ctest1 (& amp; x); Printf ("val c =% d \ n", x); // ================================= Refund area. Close (number: new (args [0] -> number value ()); } Zero Init (handle & lt; object> export) {export-> Set (string :: newSymbol ("show"), function template :: new (setport) - gt; gatefunction ()); } NODE_MODULE (add-on, init) Can anyone help?
Thanks
zero ctest1 (int *); It should be declared with extern "c" : extern "c" {void ctest1 (int *); }
No comments:
Post a Comment