Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to execute lua bytecode genrated by luac on linux

I have a simple lua source code called hello.lua

print('Hello Lua')

I complied this file to bytecode on a RedHat Linux machine , using Lua5.3.4 as follows:

luac -o hello.luac  hello.lua
chmod +x hello.luac
./hello.luac 
bash: ./hello.luac: cannot execute binary file

The architecture should be fine I guess. I cant figure what is wrong.

like image 411
sadashiv30 Avatar asked Oct 21 '25 02:10

sadashiv30


1 Answers

Precompiled Lua programs are run exactly the same way as source:

lua hello.luac
like image 196
lhf Avatar answered Oct 25 '25 09:10

lhf



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!