Re: Compiling pure Lua project into singe file
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: Compiling pure Lua project into singe file
- From: Daniel Quintela <dq@...>
- Date: 2005年2月13日 16:54:58 -0300
Mike Crowe escribió:
Hi folks,
This is probably very easy, but I can't seem to see how to do it. I
have a complete project of ~12 .lua files that I want to distribute.
Windows platform. Assume destination has lua.exe and luac.exe
I thought the answer was to:
luac -o myfile.luac file1.lua file2.lua file3.lua .... file12.lua
That creates "myfile.luac" that appears to be all the files together.
However, if I copy this file to a new directory, and execute:
lua myfile.luac
I get an error like:
lua: cannot read compat.lua: No such file or directory
stack traceback:
[C]: in function `dofile'
all.lua:9: in main chunk
(luac): in main chunk
[C]: ?
(compat.lua is one of the files in my project).
What am I missing here?
TIA
Mike
Hi Mike:
Other way to pack several scripts:
1) Download ckurmi.exe from:
http://www.soongsoft.com/software/ckurmi.exe
2) Name the main script (the first to be called) "kurmi.lua" (even if it
is compiled).
3) Compile each script separately.
4) Put all the compiled scripts inside a standard Zip file.
5) Create the exe+lua unit as:
copy ckurmi.exe/B + TheScripts.zip/B TheDist.exe/B
6) Now you can test it running TheDist.exe
Notes:
1) Use kurmi.dofile instead of dofile (or do: dofile = kurmi.dofile
before the first call).
2) You can use kurmi.loadfile (loadfile clone). Don't forget to put the
.dll inside the .zip
Regards,
DQ