Help needed Building static binaries on Windows

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Help needed Building static binaries on Windows

Stefan Schroeder
I have created a useful utility using Lua and the IUP GUI library that I want to share with my co-workers.

But I cannot expect them to install the Lua interpreter just for this tool. That's why I was looking for ways to build a
fat single executable.

I have tried everything: 

I tried 
using 
the lua-distros from 

As a last resort I am trying srlua from
But the Makefile is for Linux and Darwin only, I have tried to compile with Cygwin-Mingw,Gnuwin32-Mingw, TDM-GCC and had no success, although it was reported here:
that it would work. 

I am looking for a step-by-step guide how to compile a Lua script into a Single executable binary in Windows 10.

Can please somebody walk me through it? I feel really stupid although I am a developer w/ 20 years experience (but new to Lua, though).

Regards
Stefan
Germany
Reply | Threaded
Open this post in threaded view
|

Re: Help needed Building static binaries on Windows

Tim McCracken
You don’t need anything except the Lua source files. I use the free version of Visual Studio To build a static Lua library and just link it to my main program. I would be happy to send you the project files but I am away from my computer until Sunday evening. Let me know if you don’t get it solved by then.

Sent from my iPhone

On Nov 22, 2019, at 1:32 PM, Stefan Schroeder <[hidden email]> wrote:

I have created a useful utility using Lua and the IUP GUI library that I want to share with my co-workers.

But I cannot expect them to install the Lua interpreter just for this tool. That's why I was looking for ways to build a
fat single executable.

I have tried everything: 

I tried 
using 
the lua-distros from 

As a last resort I am trying srlua from
But the Makefile is for Linux and Darwin only, I have tried to compile with Cygwin-Mingw,Gnuwin32-Mingw, TDM-GCC and had no success, although it was reported here:
that it would work. 

I am looking for a step-by-step guide how to compile a Lua script into a Single executable binary in Windows 10.

Can please somebody walk me through it? I feel really stupid although I am a developer w/ 20 years experience (but new to Lua, though).

Regards
Stefan
Germany
Reply | Threaded
Open this post in threaded view
|

Re: Help needed Building static binaries on Windows

aryajur
In reply to this post by Stefan Schroeder
I have done this many times now on windows 10. The way I do it is first combine all my Lua script files into 1 file with  https://github.com/aryajur/many2one.

Once I have 1 script file I use glue and srlua to create the executable. I compile srlua and glue using codeblocks. I have attached the setup file here. Hope this helps.
It also helps to check http://www.dependencywalker.com/ on the executable to package other dependency dll files with your executable.

Milind

On Fri, Nov 22, 2019 at 11:32 AM Stefan Schroeder <[hidden email]> wrote:
I have created a useful utility using Lua and the IUP GUI library that I want to share with my co-workers.

But I cannot expect them to install the Lua interpreter just for this tool. That's why I was looking for ways to build a
fat single executable.

I have tried everything: 

I tried 
using 
the lua-distros from 

As a last resort I am trying srlua from
But the Makefile is for Linux and Darwin only, I have tried to compile with Cygwin-Mingw,Gnuwin32-Mingw, TDM-GCC and had no success, although it was reported here:
that it would work. 

I am looking for a step-by-step guide how to compile a Lua script into a Single executable binary in Windows 10.

Can please somebody walk me through it? I feel really stupid although I am a developer w/ 20 years experience (but new to Lua, though).

Regards
Stefan
Germany

srlua.cbp (1K) Download Attachment
glue.cbp (1K) Download Attachment