@bainem have you had any luck with this?
I’ve tried copying that library into a “xmlrpc” directory in my project, but when I try to use it with either of the following…
[lua]local xmlrpc = require(“xmlrpc”)
– or
require “xmlrpc”[/lua]
…I get a notification saying that “A runtime error occurred. Please check console output for details.”. The console shows this:
[text]
Copyright © 2009-2010 A n s c a , I n c .
Version: 2.0.0
Build: 2011.484
The file sandbox for this project is located at the following folder:
(/Users/XXXXXXX/Library/Application Support/Corona Simulator/HelloWorld-AEDF5EFDA992C00282C76B97CEC84EBD)
Runtime error
/Users/XXXXXXX/dev/android/corona/HelloWorld/main.lua:10: module ‘xmlrpc’ not found:resource (xmlrpc.lu) does not exist in archive
no field package.preload[‘xmlrpc’]
no file ‘/Users/XXXXXXX/dev/android/corona/HelloWorld/xmlrpc.lua’
no file ‘/Applications/CoronaSDK/Corona Simulator.app/Contents/Resources/xmlrpc.lua’
no file ‘/Applications/CoronaSDK/Corona Simulator.app/Contents/Resources/xmlrpc.blu’
stack traceback:
[C]: ?
[C]: in function ‘require’
/Users/XXXXXXX/dev/android/corona/HelloWorld/main.lua:10: in main chunk
Runtime error: /Users/XXXXXXX/dev/android/corona/HelloWorld/main.lua:10: module ‘xmlrpc’ not found:resource (xmlrpc.lu) does not exist in archive
no field package.preload[‘xmlrpc’]
no file ‘/Users/XXXXXXX/dev/android/corona/HelloWorld/xmlrpc.lua’
no file ‘/Applications/CoronaSDK/Corona Simulator.app/Contents/Resources/xmlrpc.lua’
no file ‘/Applications/CoronaSDK/Corona Simulator.app/Contents/Resources/xmlrpc.blu’
stack traceback:
[C]: ?
[C]: in function ‘require’
/Users/XXXXXXX/dev/android/corona/HelloWorld/main.lua:10: in main chunk
[/text]
I get the same result if I move the “xmlrpc” directory to “/Applications/CoronaSDK/Corona Simulator.app/Contents/Resources/”
I’m certain that this initial problem is related to how I’m installing the library, or how I’m calling it, and that once I sort that out I can at least move on to the next error.
I’m just getting started with Lua and Corona, and I’m just not sure how to proceed.
Does anybody have an example of how to use Lua XML-RPC with Corona? Or even a general example of how to use a third-party library with Corona?
- Update:
- OK, I got a bit further by putting "server.lua", "http.lua", and "init.lua" from the XML-RPC library directly into my project directory, and then called it with this:
[lua]local xmlrpc = require "init"[/lua]
That seemed to load the library, but then failed when it tried to load the "lxp" library:
[text]
Runtime error
/Users/XXXXXX/dev/android/corona/HelloWorld/init.lua:6: module 'lxp' not found:resource (lxp.lu) does not exist in archive
no field package.preload['lxp']
no file '/Users/XXXXXX/dev/android/corona/HelloWorld/lxp.lua'
no file '/Applications/CoronaSDK/Corona Simulator.app/Contents/Resources/lxp.lua'
no file '/Applications/CoronaSDK/Corona Simulator.app/Contents/Resources/lxp.blu'
stack traceback:
[C]: ?
[C]: in function 'require'
/Users/XXXXXX/dev/android/corona/HelloWorld/init.lua:6: in main chunk
[C]: in function 'require'
/Users/XXXXXX/dev/android/corona/HelloWorld/main.lua:10: in main chunk
[/text]
So, I think the solution here is going to be some general guidance for including and using third-party libraries in a Corona project. Anybody?
[import]uid: 61179 topic_id: 7662 reply_id: 37480[/import]