Hello Guest it is March 28, 2024, 05:55:40 PM

Author Topic: LUA call functions in dynamic libraries  (Read 1016 times)

0 Members and 1 Guest are viewing this topic.

LUA call functions in dynamic libraries
« on: July 29, 2020, 05:41:45 AM »
Hello

is it possible to integrate the Lua ALIEN package/addon in mach4?
I need Alien to call functions in dynamic libraries.

I have copied the Alien Folder and alien.lua to Mach4 Modules.
But if i started my code in debugging mode and "require "alien"" is calling, at this point "local core = require "alien.core"" the Debugging session will be closed without errors.

Maybe because of the missing Luarocks extension?

With my sepetrate LUA 5.1 installation the Alien calls works fine and without errors.

Can anyone help me?

Thanks
Robert

translated by google and myself
« Last Edit: July 29, 2020, 09:20:59 PM by Graham Waterworth »

Offline smurph

*
  • *
  •  1,544 1,544
  • "That there... that's an RV."
    • View Profile
Re: LUA call functions in dynamic libraries
« Reply #1 on: August 03, 2020, 09:41:41 PM »
We are running LUA 5.3.  I don't know much about alien, but you might have to up the version to 5.3 as well.

Steve
Re: LUA call functions in dynamic libraries
« Reply #2 on: August 05, 2020, 03:04:59 PM »
Hi Steve

If I understand that correctly, Alien can be run with Lua 5.3.
https://github.com/mascarenhas/alien

I tried to update my Lua 5.1 installation to 5.3 (lua.exe, luac.exe, wlua.exe, lua53.dll).
But when I run "require" wx "" or "require" alien "" I get the following error:

lua: error loading module 'alien.core' from file 'F: \ Program Files \ Systemtools \ Lua 5.1 \ clibs \ alien \ core.dll':
% 1 is not a valid Win32 application
I don't know why.

I don't know what to do with ZeroBraneStudio and Alien either.
Maybe paths are wrong or missing files that Alien needs, I don't know.
I only started learning Lua a few months ago.

Maybe I will find another solution to get to my external dll functions.

thanks
Robert

Offline smurph

*
  • *
  •  1,544 1,544
  • "That there... that's an RV."
    • View Profile
Re: LUA call functions in dynamic libraries
« Reply #3 on: August 05, 2020, 07:47:59 PM »
Yes, it will work with either 5.1 or 5.3, but the binaries better match the version of LUA that you are using.  Right now, it looks like your alien was compiled for LUA 5.1.  So you need to get alien that is compiled to use LUA 5.3.  I think that is all you need.

Once you upgrade your alien from 5.1 to 5.3, Zerobrane won't have an issue with it.

Steve