Single exe app


  • Hi,

    I'm trying to make a single exe app from a simple lua file, myapp.lua.
    After entering:-

    .mgit/bundle.sh -M myapp.lua - o test.exe

    I get:-

    .mgit.bundle.sh: line 423: .mgit/platform.sh: No such file or directory
    Unable to set platform.

    I checked the .mgit directory and there is no platform.sh file.
    Do I need to create it?

    I'm running on a 64bit windows machine, and using luapower-ming32.

    Thanks,
    Garry.


  • 7
    Posts
    2113
    Views
    Log in to reply


  • platform.sh is part of luapower-repos

    I haven't included luapower-repos in the all-in-one zip files because these are part of the git way of deploying.

    So just download and unzip luapower-repos over your luapower directory as usual to get those files. Looks like you already got multigit.



  • Got it all working now - Thanks. And yes I did get multigit.

    Luapower is looking more and more like a great develoment system as my understanding of it improves. I like programming in Lua, and the utilities and packages that you have included make it a very complete setup for my needs.

    Thanks again.



  • That's very nice to hear. If you can share what you've found to be missing/surprising/complicated in your learning curve I would appreciate that. I'm always interested to plug the holes in the docs (I'm sure there are some) and to re-organize and re-design things. Thanks.



  • Hi Cosmin

    As you have probably guessed I'm a bit of a noob at all this. I think most of my problems are due to my lack of experience. For instance, I've never used git before.

    So I tried the git method of installing Luapower and that worked fine. Now I have a full install with no missing files (that were the cause of my earlier problems.)

    However, I am still having issues creating a standalone .exe of my app.
    I can generate the .exe with a command:-
    .mgit/bundle.sh -M myapp -o test.exe
    but it turns out to have dependencies which I would rather avoid.
    For instance it's dependent on the winapi folder being preset.
    I can add individual winapi modules to the command, (with the -m option) but it seems I have to add nearly all of them to avoid the dependency. Is there an easier way to do this?

    My app also uses cairo and the resultant .exe is dependent on cairo.dll being present.
    I tried including the cairo static lib in the command (with the -a option) but that produced numerous errors. (mostly "undefined reference to" errors)

    Still learning :)

    Regards,
    Garry.



  • Yes, the bundle doc page could use some attention - more examples, more explainations.

    The general rule is that you have to bundle everything that you know you use + all dependencies. That includes Lua modules and C modules. Anything that you don't specify will remain an external dependency. This is because bundle itself is just a simple script that invokes the gcc linker, it doesn't know how to track dependencies for you (the luapower reflection module/command knows all about dependencies but it doesn't know how to print out a bundle command yet).

    In your case, you have to add cairo's dependencies -- these are listed on the website under the section "binary dependencies" (for cairo it's zlib, libpng, freetype AFAIR).

    About adding all winapi, you could use bundle -m 'winapi.lua winapi/*.lua'.

    The reason all these tools are separate and not integrated (multigit, bundle, luapower) is because of "do only one thing and do it well" mantra which greatly clarifies their purpose I think, so for instance, multigit has nothing specific to do with luapower but has everything to do with version control, so you can apply to a lot of situations. Likewise, you could take the bundle script and use it on your own Lua projects as long as you have static libs.



  • Got it! My app is now running with no dependencies. Thanks for all your help.


7
Posts
2113
Views
Log in to reply

Internal error.

Oops! Looks like something went wrong!