lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


This is what each of the generated executables print when run.
I applied the suggested changes (adding include and name assignment),
but this made no difference.

D:\src\srlua-102>.\glue.exe
usage: .\glue.exe in.exe in.lua out.exe

D:\src\srlua-102>.\srlua.exe

D:\src\srlua-102>.\out.exe

(in other words: Nothing is printed)
I've tried to link against lua5.1dll, lua51.dll, lua53.dll, lua5.3.dll.
When adding a simple printf("Hello"); in main of srlua, this is also
not printed.

Something is severely amiss, but there are too many moving parts to
use trial-and-error to figure it out.

Then I looked up the meaning of "-mwindows"? The GCC manual says that
this is for "GUI applications".
I removed it, and, TA-DAH, it works, even after reverting the changes
suggested by Luiz.

Thanks everybody for your help. I will def. come back later, because I
have the gut feeling that using srlua for a complex
application will be much harder than a trivial one.

@Luiz: Do you mind if I provide a patch for the Makefile of srlua-102?

thx

Am Mo., 25. Nov. 2019 um 13:00 Uhr schrieb <lua-l-request@lists.lua.org>:
>
> Date: Mon, 25 Nov 2019 08:15:05 -0300
> From: Luiz Henrique de Figueiredo <lhf@tecgraf.puc-rio.br>
> Subject: Re: Help needed Building static binaries on Windows
> To: Lua mailing list <lua-l@lists.lua.org>
> Message-ID:
>         <CAD55k3oVMHsyUK9N-x3uqKjtDmYapvGAEp0mSLRr7XgK1DA0Mw@mail.gmail.com>
> Content-Type: text/plain; charset="UTF-8"
>
> > While it compiles and creates "out.exe", it doesn't work, because
> > "out.exe" doesn't print anything when run (no error, but also no
> > hello).
>
> What happens when you run srlua.exe? It should say something like
>
> ./srlua.exe: cannot find a Lua program in ./srlua.exe: no glue
>
> Otherwise, try adding this line in main just after lua_State *L:
>
> char name[MAX_PATH]; argv[0]=
> GetModuleFileName(NULL,name,sizeof(name)) ? name : NULL
>
> and this line just before the first #include:
>
> #include <windows.h>
>
>
>