Hi All,
I'm trying to add a C module to my 0.10 eLua rom image. I've used the instructions at http://wiki.eluaproject.net/Tutorials/cmodules as a guide but I do not understand how to add my module to the rom. I can see that my module has been compiled and has an entry in the .map file. When I try and access it on my development board though I get an "attempt to index global 'json' (a nil value)" error. Can anyone point out what I've failed todo? Thanks, Graham. |
Hi, That tutorial needs to be updated since it is written for the older SCons-based build system. The newer Lua-based build system handles things a bit differently. At this point I believe you may only need to extend the elua_generic_modules table in conf/modules.lua (https://github.com/elua/elua/blob/master/config/modules.lua#L25), by adding, a line like: json = {}, Let me know if that works. Best. -jsnyder On Tue, Mar 24, 2015 at 11:30 AM, grahams [via eLua Development] <[hidden email]> wrote: Hi All, James Snyder ph: (847) 448-0386 |
I think I may be nearly there,
Adding "json = {}" made a difference but has not fixed it. When I start lua from the terminal I now get "lua: attempt to index a function value" output and the lua interrupter fails to start. Graham |
Hi Graham, Could you provide the luaopen & map definitions from your file? I suspect the issue might be there. Also, are you running a script or just starting up the Lua prompt with no arguments? If you can't provide that, see the other modules in src/modules for how these portions should be set up. I was able to take the tutorial on the wiki and with a few minor edits plus what I recommended I had it working in the image. I've saved a few quick changes to that to be more consistent with the current build system. Best. -jsnyder On Tue, Mar 24, 2015 at 12:29 PM, grahams [via eLua Development] <[hidden email]> wrote: I think I may be nearly there, James Snyder ph: (847) 448-0386 |
Free forum by Nabble | Edit this page |