Integrating Lua

Creating, porting and using libraries with Ultibo
msx80
Posts: 32
Joined: Thu Aug 02, 2018 8:38 am

Re: Integrating Lua

Postby msx80 » Mon Oct 01, 2018 8:50 am

Ps also a trick that i spent a lot to discover: if you want to attach your own object to a Lua state, you can use an "extra space" that's reserved by lua like so:

Code: Select all

// set the object
ppointer(lua_getextraspace(state))^ := myObject;


Code: Select all

// get the object
myObject := TMyObject(lua_getextraspace(state)^);
msx80
Posts: 32
Joined: Thu Aug 02, 2018 8:38 am

Re: Integrating Lua

Postby msx80 » Mon Oct 08, 2018 8:14 am

I've updated the project to also include Rpi2 version. I needed to compile liblua.a with different settings to have it run on Rpi2. It's included in the repo
User avatar
mvdhoning
Posts: 11
Joined: Thu Dec 06, 2018 6:51 pm
Contact:

Re: Integrating Lua

Postby mvdhoning » Thu Dec 06, 2018 7:20 pm

can you share info on how to compile the liblua.a ? i want to use lua with the rpi3
i already have a fairly complete lua 5.3 unit. that is dynamic linking only so i need to do some changes to it to support liblua.a
msx80
Posts: 32
Joined: Thu Aug 02, 2018 8:38 am

Re: Integrating Lua

Postby msx80 » Fri Dec 07, 2018 10:43 am

mvdhoning wrote:can you share info on how to compile the liblua.a ? i want to use lua with the rpi3
i already have a fairly complete lua 5.3 unit. that is dynamic linking only so i need to do some changes to it to support liblua.a


There's a makefile in the project. Run it from inside the src directory of your lua distribution.

I haven't tested it on RPI3, don't have one unfortunately.
User avatar
mvdhoning
Posts: 11
Joined: Thu Dec 06, 2018 6:51 pm
Contact:

Re: Integrating Lua

Postby mvdhoning » Fri Dec 07, 2018 7:00 pm

msx80 wrote:There's a makefile in the project. Run it from inside the src directory of your lua distribution.

Thanks i will try this out this weekend (if time permits).
Here is my lua github repo: https://github.com/mvdhoning/dlua/
I definetely need to rewrite the unit for static linking. But first i try yours maybe that is complete enough.

Return to “Libraries”

Who is online

Users browsing this forum: No registered users and 1 guest