[luatex] Different behaviour beetween LuaTeX e Lua

Michele Muccioli asuka_michele at yahoo.it
Fri May 26 12:40:55 CEST 2017


Dear all,
  I'm trying to write a module in Lua in order to use it in LuaTeX.  I use TexLive 2016 with LuaTeX Version 0.95.0 (which has Lua version 5.2.*) and mingw with gcc 5.3.0 as C compiler.On my computer there is Lua version 5.2.4.
I compile the module (see attachment called LuaBasic.c) in the following way
  1) Compile the .c file enabling some Lua definitions in order to have the possibility to create the dll x windows.       gcc -O2 -c -DLUA_CORE -DLUA_BUILD_AS_DLL -o LuaBasic.o LuaBasic.c -I"C:\Users\Michele\Desktop\LuaSketch\LuaSketch_C\lua_src"    2) Link the .o file to the dynamic library present in the TexLive folder (as you can see in the -L and -l options)       gcc -O -shared -o LuaBasic.dll LuaBasic.o -L"C:\texlive\2016\bin\win32" -l "lua52"    3) Delete the .o file       del LuaBasic.o
The problem is: I have two different behaviour, the first when I use the module LuaBasic into Lua 5.2.4  and the second when used into LuaTeX.
In the first case I have no problems as you can see from theh attached pictured called  LuaBasic_used_by_Lua5.2_NO_PROBLEM.png.
In the second case when I compile LuaLaTeX file called LuaBasic_test.tex, it crashes as you can see from the attached picture called LuaBasic_crashed.png. After several times compiling the tex file, a correct pdf is made.
In your opinion, where is the problem? Is the C source or something in the LuaTex?
Many thanks in advance for any suggestions.
Michele
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/luatex/attachments/20170526/9a0d2645/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: LuaBasic.c
Type: application/octet-stream
Size: 2335 bytes
Desc: not available
URL: <http://tug.org/pipermail/luatex/attachments/20170526/9a0d2645/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: LuaBasic.dll
Type: application/x-msdownload
Size: 21880 bytes
Desc: not available
URL: <http://tug.org/pipermail/luatex/attachments/20170526/9a0d2645/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: LuaBasic_crashed.png
Type: image/png
Size: 156005 bytes
Desc: not available
URL: <http://tug.org/pipermail/luatex/attachments/20170526/9a0d2645/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: LuaBasic_test.tex
Type: application/octet-stream
Size: 395 bytes
Desc: not available
URL: <http://tug.org/pipermail/luatex/attachments/20170526/9a0d2645/attachment-0003.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: LuaBasic_used_by_Lua5.2_NO_PROBLEM.png
Type: image/png
Size: 112228 bytes
Desc: not available
URL: <http://tug.org/pipermail/luatex/attachments/20170526/9a0d2645/attachment-0003.png>


More information about the luatex mailing list