News : The level of daily SPAM has reached insane proportions, all registrations are now manual. I ask you to send me an e-mail (john (at) murga (dot) org), to confirm that you want me to create an account for you.


Post Reply  Post Thread 
Pages (2): « First [1] 2 Next > Last »
Adding a Package
Author Message
asafp
Member
***


Posts: 81
Group: Registered
Joined: Jan 2008
Status: Offline
Reputation: 0
Post: #1
Adding a Package

I found the lua documentation on adding a package to be confusing. luarocks got me even more confused. Adding mysql support to murgalua on windows turned out to be simple.

Downloaded the binary package http://luaforge.net/frs/download.php/268...-lua51.zip
and extracted the mysql.dll to subdirectory \luasql. I also had to find and download libmysql.dll and put it into my current directory.

Then used

Code:
require("luasql.mysql")


to load the module.

It would be a good idea to include a few examples of this kind of thing in the murgalua documentation. It would also cut down on the number of requests to have additional packages added to the standard murgalua distribution.

04-01-2008 05:47 AM
Visit this user's website Find all posts by this user Quote this message in a reply
JohnMurga
Administrator
*******


Posts: 381
Group: Administrators
Joined: Apr 2007
Status: Offline
Reputation: 2
Post: #2
RE: Adding a Package

Hi,

Thanks for the post.

It is funny you should say that ...

I was thinking about this as I put the finishing touches on 0.6.8 (which justifies a higher version number).

0.6.8 includes the "luacom" module for Windows with examplea of this kind of use of an external module.

And I'll push the Wiki out this week to allow people put up such examples.

Cheers
John de Murga

04-01-2008 07:22 AM
Visit this user's website Find all posts by this user Quote this message in a reply
asafp
Member
***


Posts: 81
Group: Registered
Joined: Jan 2008
Status: Offline
Reputation: 0
Post: #3
RE: Adding a Package

Thanks John. One of the nice things about PuppyLinux is how people can easily package their own flavor. It'd be really cool if there was a murgalua installer program that would ask a few simple questions then fetch what's needed, unzip it and put it all in the right place.

04-01-2008 08:43 AM
Visit this user's website Find all posts by this user Quote this message in a reply
mikshaw
Senior Member
****


Posts: 522
Group: Registered
Joined: Apr 2007
Status: Offline
Reputation: 5
Post: #4
RE: Adding a Package

Unfortunately such a feature would probably be useful only to Windows users. I have yet to find a precompiled Lua module for Linux (at least one that would work for a decent number of distros...not just the one for which it was compiled).

04-01-2008 11:04 AM
Find all posts by this user Quote this message in a reply
asafp
Member
***


Posts: 81
Group: Registered
Joined: Jan 2008
Status: Offline
Reputation: 0
Post: #5
RE: Adding a Package

Sometimes I wonder why people use Windows when Linux is free and has to some degree all of the same features. Then someone like mikshaw comes along and straightens me out.

The lua all in one project (luaaio) would seem to have some synergies with a murgalua packaging project. They recently released their first linux package which has mysql.so and a bunch of other xxxxx.so modules. I guess you'd still need to make sure there is a compatible libmysql.so.xx.

04-01-2008 01:21 PM
Visit this user's website Find all posts by this user Quote this message in a reply
briss
Junior Member
**


Posts: 1
Group: Registered
Joined: Nov 2007
Status: Offline
Reputation: 0
Post: #6
RE: Adding a Package

Quote:
Adding mysql support to murgalua on windows turned out to be simple.

Downloaded the binary package and extracted the mysql.dll to subdirectory \luasql. I also had to find and download libmysql.dll and put it into my current directory.

Then used require("luasql.mysql")

to load the module


trying this with murgalua v 0.6.4 on my winXP PC, i also had to put lua5.1.dll and msvcr80.dll in the bin directory. the first lua5.1.dll downloaded was not the good one and launching lua script with require("luasql.mysql") gave me the error message here attached. using lua5.1.dll and msvcr80.dll from luabinaries solved this problem:
lua binaries



Attached File(s) Thumbnail(s)
   

This post was last modified: 09-03-2008 05:39 PM by briss.

09-03-2008 05:35 PM
Find all posts by this user Quote this message in a reply
asafp
Member
***


Posts: 81
Group: Registered
Joined: Jan 2008
Status: Offline
Reputation: 0
Post: #7
RE: Adding a Package

briss Wrote:

Quote:
Adding mysql support to murgalua on windows turned out to be simple.

Downloaded the binary package and extracted the mysql.dll to subdirectory \luasql. I also had to find and download libmysql.dll and put it into my current directory.

Then used require("luasql.mysql")

to load the module


trying this with murgalua v 0.6.4 on my winXP PC, i also had to put lua5.1.dll and msvcr80.dll in the bin directory. the first lua5.1.dll downloaded was not the good one and launching lua script with require("luasql.mysql") gave me the error message here attached. using lua5.1.dll and msvcr80.dll from luabinaries solved this problem:
lua binaries


I am getting this same error. I believe I had luasql working correctly with murgalua prior to installing the latest 0.6.8 murgalua. I've got lua5.1.dll and msvcr80.dll out there.

10-16-2008 03:44 AM
Visit this user's website Find all posts by this user Quote this message in a reply
art
Junior Member
**


Posts: 7
Group: Registered
Joined: Sep 2008
Status: Offline
Reputation: 0
Post: #8
RE: Adding a Package

I think you just copy lua5.1.dll in your directory without msvcr80.dll,
But make sure lua5.1.dll from lua-5.1.2 version.

It work with any murgaLua version, but i don't know why if i have more than one callback, example in button1 and button2 both have callback, causing problem (error in murgaLua.exe).

This is my script and error message in attachment, test.lua=
=====================================================
require "luasql.mysql"

function connection()
env = assert(luasql.mysql())
con = assert(env:connect ("mydb","root","superuseradmin","localhost","3306"))
str = "select 1 from dual"
q = assert(con:execute (str))
num = q:numrows()
msg:label(num)
q:close()
con:close()
env:close()
end

window = fltk:Fl_Double_Window(100, 100, 800, 600, "Test")
button1 = fltk:Fl_Button(10, 10, 150, 25, "Test Connection")
button1:callback(connection) -- <= callback 1
msg = fltk:Fl_Box(20, 10, 600, 25)
button2 = fltk:Fl_Button(10, 40, 150, 25, "Test Connection2")
button2:callback(connection) -- <= callback 2 cause error, if i remove this callback not causing error

window:show()
Fl:scheme("plastic")
Fl:run()
=====================================================

JohnM or everyone can help?



Attached File(s) Thumbnail(s)
   
11-21-2008 10:38 AM
Visit this user's website Find all posts by this user Quote this message in a reply
mikshaw
Senior Member
****


Posts: 522
Group: Registered
Joined: Apr 2007
Status: Offline
Reputation: 5
Post: #9
RE: Adding a Package

The screenshot is just a generic Windows error message and isn't very useful in diagnosing the specific trouble. The error report could have been more useful. If not, try running the application from within a cmd window and look at the output.

There should not be an issue with assigning the same callback to two different buttons. The only thing I can think of at the moment is that maybe you tested by pressing button1 and then pressing button2 while the callback was still running. That might cause a problem trying to open a file that is already opened. If button1 by itself works, button2 by itself should too.

I don't know diddly about the assert fuction, so for all know that might have something to do with it too.

11-24-2008 02:25 AM
Find all posts by this user Quote this message in a reply
asafp
Member
***


Posts: 81
Group: Registered
Joined: Jan 2008
Status: Offline
Reputation: 0
Post: #10
RE: Adding a Package

I had a bitch of a time getting mysql to work with murgaLua. Scrounging around the internet, I finally found a DLL that seems to work. It dates back to early in 2006. You can download it here http://asafp.com/luamysql.dll

On Linux, I'm getting the following message:

error loading module 'mysql' from file './mysql.so':
./mysql.so: undefined symbol: lua_pushnil

11-25-2008 07:31 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Pages (2): « First [1] 2 Next > Last »
Post Reply  Post Thread 

View a Printable Version
Send this Thread to a Friend
Subscribe to this Thread | Add Thread to Favorites

Forum Jump: