× Components and Libraries for Scripting Development, discussions, problems and suggestions

Important Lua!

  • 4aiman
  • 4aiman's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Comix creator
More
7 years 6 months ago - 7 years 6 months ago #3020 by 4aiman
Lua! was created by 4aiman
There are 2 units available in the CT 3.1 which has LUA in their names:
lua, lualib
.
On the other side I have this little demo shared library project written in C:
#include <iostream>
#include <luabind/luabind.hpp>

void greet()
{
    std::cout << "hello world!\n";
}

extern "C" int init(lua_State* L)
{
    using namespace luabind;

    open(L);

    module(L)
    [
        def("greet", &greet)
    ];

    return 0;
}
Original

How could I port that to work within CT?

Warning: Spoiler!

I'm starting to doubt there are no mistakes in my DNA... 'Cause before I unchecked -WR option CT was complaining about it's "illegal-ity" :(

Anyone knows smth?

I can find an alternative by testing every lua_open* function, but what's this supposed to mean:
module(L)
    [
        def("greet", &greet)
    ];

コンソールマニアック
Last edit: 7 years 6 months ago by 4aiman. Reason: have found liblua5.1.so.0.0.0 O_o

Please Log in or Create an account to join the conversation.

  • avra
  • Visitor
  • Visitor
7 years 6 months ago - 7 years 6 months ago #3033 by avra
Replied by avra on topic Lua!
one of the pages I got after googling for lua lualib delphi:
www.codeforge.com/read/85205/lualib.pas__html
Look at LuaTestmain.pas
Last edit: 7 years 6 months ago by avra.

Please Log in or Create an account to join the conversation.

  • 4aiman
  • 4aiman's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Comix creator
More
7 years 6 months ago #3034 by 4aiman
Replied by 4aiman on topic Lua!
Thanks! Googled for 8 hours but hadn't come across that.
The "bad" thing is that's "unconvertable", 'cause of some undefined functions and types.
Maybe there are some fpc example? that'll do too.

コンソールマニアック

Please Log in or Create an account to join the conversation.

  • 4aiman
  • 4aiman's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Comix creator
More
7 years 5 months ago #3271 by 4aiman
Replied by 4aiman on topic Lua!
Uhm... Bump?..

コンソールマニアック

Please Log in or Create an account to join the conversation.

More
7 years 5 months ago #3300 by Arioch
Replied by Arioch on topic Lua!
Well, there are two Lua bindings for Delphi. Considered their adaptation for FPC ?

Please Log in or Create an account to join the conversation.

  • Sternas Stefanos
  • Sternas Stefanos's Avatar
  • Offline
  • Moderator
  • Moderator
  • Ex Pilot, M.Sc, Ph.D
More
7 years 5 months ago #3301 by Sternas Stefanos
Replied by Sternas Stefanos on topic Lua!
Look at CT FPC packages

codetyphon\fpcsrc\packages\lua\src

PilotLogic Architect and Core Programmer
Attachments:

Please Log in or Create an account to join the conversation.

More
7 years 5 months ago #3302 by Arioch
Replied by Arioch on topic Lua!
"LAUxlib" ? :-D

Please Log in or Create an account to join the conversation.

  • 4aiman
  • 4aiman's Avatar Topic Author
  • Offline
  • Junior Boarder
  • Junior Boarder
  • Comix creator
More
7 years 5 months ago #3312 by 4aiman
Replied by 4aiman on topic Lua!
I have looked at that, but, as I've said before, I can find an alternative for this:
module(L)
    [
        def("greet", &greet)
    ];

How can I do this?

PS: I can't look at anything atm, because of this: http://www.pilotlogic.com/sitejoom/index.php/forum/forums-general/2417-installation-fails-under-ubuntu-12-04-mate#3311

コンソールマニアック

Please Log in or Create an account to join the conversation.