function love.load()
lib=require("libtest514")
end
_dt=0
function love.update(dt)
_dt=dt
end
function love.draw()
love.graphics.printf(_dt, 1, 1,1)
end
Last edited by dracula004 on Fri May 15, 2015 1:22 am, edited 1 time in total.
If you have a 32bit dll, you have to use the 32bit löve runtime. If you have a 64bit dll, you have to use the 64bit löve runtime.
I downloaded your project and tested it. It works well.
But I still don't know how to build a dll which is compatible with LOVE2D.
btw,I know how to build a dll for lua, are they different?
If you have a 32bit dll, you have to use the 32bit löve runtime. If you have a 64bit dll, you have to use the 64bit löve runtime.
I downloaded your project and tested it. It works well.
But I still don't know how to build a dll which is compatible with LOVE2D.
btw,I know how to build a dll for lua, are they different?
Is your DLL x64 or x32? As SiENce said, it needs to match the LÖVE version you are running.
If you have a 32bit dll, you have to use the 32bit löve runtime. If you have a 64bit dll, you have to use the 64bit löve runtime.
I downloaded your project and tested it. It works well.
But I still don't know how to build a dll which is compatible with LOVE2D.
btw,I know how to build a dll for lua, are they different?
Is your DLL x64 or x32? As SiENce said, it needs to match the LÖVE version you are running.
both are x32.
I read the source code of luamidi.
then I bulid a new dll in Code::Blocks with GCC(MinGW). The C::B project will be attached below.
As always, it works well in lua, but crashes in love2d. wtf?
function love.load()
lib=require("lovelib")
end
_dt=0
function love.update(dt)
_dt=dt
end
function love.draw()
love.graphics.printf(lib.doubles(_dt), 1, 1,1)
end
just a shot in the dark, but, from the code i saw, in plain lua, you passed an integer into the function defined by the dll, but in löve, you're passing in a floating point. perhaps this is the issue?
Me and my stuff True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
zorg wrote:just a shot in the dark, but, from the code i saw, in plain lua, you passed an integer into the function defined by the dll, but in löve, you're passing in a floating point. perhaps this is the issue?
that's not the point. even I don't need to call the function in the dll, when I require the dll, love2d will crash.
and the source code of the doubles function are shown below: