X64 lua.a problem has never been solved: ask the great god for help

New to FreeBASIC? Post your questions here.
Post Reply
htm_hx
Posts: 17
Joined: May 24, 2017 19:42

X64 lua.a problem has never been solved: ask the great god for help

Post by htm_hx »

test.lua
--------------------------------------------------------------------------------------------------------
function Main()
local var1 = 123
end
--------------------------------------------------------------------------------------------------------


Script execution

Under FB debugging or after the DLL is generated, the execution is normal

--------------------------------------------------------------------------------------------------------
test.lua
--------------------------------------------------------------------------------------------------------
function Main()
local var1 = 123.123

end
--------------------------------------------------------------------------------------------------------
After adding decimals, it is normal under FB debugging

Generating DLL execution will cause the process to disappear

What went wrong is

The luaL_loadfile function

FB :
--------------------------------------------------------------------------------------------------------
sub Test()
Dim As lua_State Ptr L
L = luaL_newstate()
luaL_openlibs(L)
OutputDebugString("[DBG]Path:" + ExePath())

If (luaL_loadfile(L, ExePath() + "\test.lua") <> 0 ) Then

OutputDebugString("[DBG]LuaErr1:" + *lua_tostring(L,-1))
Return
Else
lua_pcall(L,0,0,0)
lua_pop(L,-1)
lua_getglobal(L,"Main")
If lua_pcall(L,0,0,0) <> 0 Then

OutputDebugString("[DBG]LuaErr2:" + *lua_tostring(L,-1))
EndIf
lua_pop(L,-1)
lua_close( L )
Endif
end
Post Reply