On Thu, Feb 7, 2013 at 6:41 PM, Jorge Chamorro <[email protected]> wrote: > On 07/02/2013, at 22:03, Kevin Baker wrote: > >> Unfortunately the library that is getting built doesn't work in the target >> environment: >> >> root@device:/usr/lib/node_modules/npm/node_modules/sqlite3# node >> > var sqlite3 = require('./node-sqlite3.node').verbose(); >> Error: /usr/lib/node_modules/npm/node_modules/sqlite3/node-sqlite3.node: >> undefined symbol: init >> at Object.Module._extensions..node (module.js:485:11) >> at Module.load (module.js:356:32) >> at Function.Module._load (module.js:312:12) >> at Module.require (module.js:362:17) >> at require (module.js:378:17) >> at repl:1:15 >> at REPLServer.self.eval (repl.js:109:21) >> at rli.on.self.bufferedCmd (repl.js:258:20) >> at REPLServer.self.eval (repl.js:116:5) >> at Interface.<anonymous> (repl.js:248:12) >> > >> >> My question is, what are the steps from here? I'm not really familiar with >> the internals of node libraries or node-gyp to know what is not working. I >> can provide the built object or an armv7a node if it would help... >> >> Looking at an objdump of the module, it doesn't look like there is an init... > > Double check that the NODE_MODULE(your_modules_name, > your_modules_entry_point) macro is in its place. > > Do a gcc -E to verify that it's expanding properly to something like this: > > extern "C" { node::node_module_struct your_modules_name_module = { (1), > __null, "/path/to/src.c", your_modules_entry_point, "your_modules_name" }; } > > Also once built you *can't* rename the your_modules_name.node to anything !== > than the your_modules_name you passed to NODE_MODULE. > > hth, > -- > Jorge. > Thanks for the quick responses! I wanted to make sure I was going the right direction...
This is with the node-sqlite3 git HEAD (https://github.com/developmentseed/node-sqlite3). I figured it would be a safe choice to build since it seems like the most official sqlite3 binding for node... It looks like it possibly needs updates related to the build with node-gyp, as all the related init methods I could find are capital-I Init, and marked static (not in the .cc files, but in the .h files): ~/git/node-sqlite3/src$ egrep -wi init * database.cc:void Database::Init(Handle<Object> target) { database.h: static void Init(Handle<Object> target); node_sqlite3.cc: Database::Init(target); node_sqlite3.cc: Statement::Init(target); statement.cc:void Statement::Init(Handle<Object> target) { statement.h: static void Init(Handle<Object> target); I don't think these are the correct init functions, though? Looking at https://www.cloudkick.com/blog/2010/aug/23/writing-nodejs-native-extensions/ for example and from Ben's response suggests a separate init() call that I cannot find anywhere in node-sqlite3. The last code commit to node-sqlite3 was 8 months ago, is it possible the module calling conventions have been updated since then? I will try adding one according to the article... Thanks, Kevin -- -- 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 [email protected] To unsubscribe from this group, send email to [email protected] 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 the Google Groups "nodejs" 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/groups/opt_out.
