[SOLVED]HELP! How to make a dll available for Love2D ?

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
User avatar
s-ol
Party member
Posts: 1077
Joined: Mon Sep 15, 2014 7:41 pm
Location: Cologne, Germany
Contact:

Re: HELP! How to make a dll available for Love2D ?

Post by s-ol »

arampl wrote:Try rebuild dll with VS or QT Creator.
His build system isn't the problem, he manages to build working DLLs for standalone Lua. And doesn't QTCreator use the same toolchain anyway (MinGW)?

s-ol.nu /blog  -  p.s-ol.be /st8.lua  -  g.s-ol.be /gtglg /curcur

Code: Select all

print( type(love) )
if false then
  baby:hurt(me)
end
User avatar
dracula004
Prole
Posts: 17
Joined: Tue Mar 03, 2015 2:50 am
Location: Asia

Re: HELP! How to make a dll available for Love2D ?

Post by dracula004 »

S0lll0s wrote:Maybe you are building The DLL for an incompatible lua version? Löve is Lua 5.1 / Luajit, your "regular" lua might be 5.2.
I build it with lua5.1.4.
github:https://github.com/Nigh

email:xianyi.xia#outlook.com
User avatar
arampl
Party member
Posts: 248
Joined: Mon Oct 20, 2014 3:26 pm

Re: HELP! How to make a dll available for Love2D ?

Post by arampl »

S0lll0s wrote:
arampl wrote:Try rebuild dll with VS or QT Creator.
His build system isn't the problem, he manages to build working DLLs for standalone Lua. And doesn't QTCreator use the same toolchain anyway (MinGW)?
http://wiki.qt.io/Mingw:

"There are actually different MinGW toolchains and packages available:

MinGW.org is the original project. The latest version gcc 4.7.2. It only compiles for 32 bit binaries.

MinGW-w64 is a fork with the original aim to also support generation of 64 bit binaries. By now it also supports a much larger part of the Win32 API. The MinGW-w64 project does host several different binary packages, done by different people.

There are binary installers targetting MinGW for both Qt 4 and Qt 5. Up to Qt 4.8.6, Qt 4 ones are built with a MinGW.org toolchain using gcc 4.4. Newer Qt 4.8 binary packages ship with a mingw-w64 based toolchain. For Qt 5, a newer MinGW-w64 toolchain is actually required."

(I mean that MinGW-w64 improves not only 64-bit stuff)

I've thought Code::Blocks is outdated somehow and MinGW too.

@dracula004: Are you sure you need cpp and not plain c for your library?
User avatar
dracula004
Prole
Posts: 17
Joined: Tue Mar 03, 2015 2:50 am
Location: Asia

Re: HELP! How to make a dll available for Love2D ?

Post by dracula004 »

arampl wrote:
S0lll0s wrote:
arampl wrote:Try rebuild dll with VS or QT Creator.
His build system isn't the problem, he manages to build working DLLs for standalone Lua. And doesn't QTCreator use the same toolchain anyway (MinGW)?
http://wiki.qt.io/Mingw:

"There are actually different MinGW toolchains and packages available:

MinGW.org is the original project. The latest version gcc 4.7.2. It only compiles for 32 bit binaries.

MinGW-w64 is a fork with the original aim to also support generation of 64 bit binaries. By now it also supports a much larger part of the Win32 API. The MinGW-w64 project does host several different binary packages, done by different people.

There are binary installers targetting MinGW for both Qt 4 and Qt 5. Up to Qt 4.8.6, Qt 4 ones are built with a MinGW.org toolchain using gcc 4.4. Newer Qt 4.8 binary packages ship with a mingw-w64 based toolchain. For Qt 5, a newer MinGW-w64 toolchain is actually required."

(I mean that MinGW-w64 improves not only 64-bit stuff)

I've thought Code::Blocks is outdated somehow and MinGW too.

@dracula004: Are you sure you need cpp and not plain c for your library?
As same with the luamidi:https://github.com/dwiel/luamidi, it built with g++ 8 years ago,works well in love2d today.
github:https://github.com/Nigh

email:xianyi.xia#outlook.com
Lapin
Prole
Posts: 19
Joined: Fri Mar 20, 2015 11:53 am

Re: HELP! How to make a dll available for Love2D ?

Post by Lapin »

Oh you can use Lua FFI.
Example :

https://github.com/CapsAdmin/goluwa/blo ... s/init.lua

And it works.
User avatar
dracula004
Prole
Posts: 17
Joined: Tue Mar 03, 2015 2:50 am
Location: Asia

Re: HELP! How to make a dll available for Love2D ?

Post by dracula004 »

Lapin wrote:Oh you can use Lua FFI.
Example :

https://github.com/CapsAdmin/goluwa/blo ... s/init.lua

And it works.
thx, I will have a try.
github:https://github.com/Nigh

email:xianyi.xia#outlook.com
User avatar
dracula004
Prole
Posts: 17
Joined: Tue Mar 03, 2015 2:50 am
Location: Asia

Re: HELP! How to make a dll available for Love2D ?

Post by dracula004 »

Lapin wrote:Oh you can use Lua FFI.
Example :

https://github.com/CapsAdmin/goluwa/blo ... s/init.lua

And it works.
I tried the alien lib for lua. And the same, works well in standalone lua, but crashed in love2d...

here is the project files:
test.7z
(15.6 KiB) Downloaded 98 times
when I run main.lua in love2d, it crashes.
when I run lua_script.lua in standalone lua, it works well.
github:https://github.com/Nigh

email:xianyi.xia#outlook.com
User avatar
I~=Spam
Party member
Posts: 206
Joined: Fri Dec 14, 2012 11:59 pm

Re: HELP! How to make a dll available for Love2D ?

Post by I~=Spam »

Can you post the error that is given in the console? Or does LOVE really crash?

Can you post the C/C++ source? That would be really helpful for us to help you. ;)
My Tox ID: 0F1FB9170B94694A90FBCF6C4DDBDB9F58A9E4CDD0B4267E50BF9CDD62A0F947E376C5482610
User avatar
dracula004
Prole
Posts: 17
Joined: Tue Mar 03, 2015 2:50 am
Location: Asia

Re: HELP! How to make a dll available for Love2D ?

Post by dracula004 »

I~=Spam wrote:Can you post the error that is given in the console? Or does LOVE really crash?

Can you post the C/C++ source? That would be really helpful for us to help you. ;)
The source was already attached in former post.

I'm trying to build that dll with vs.
github:https://github.com/Nigh

email:xianyi.xia#outlook.com
User avatar
I~=Spam
Party member
Posts: 206
Joined: Fri Dec 14, 2012 11:59 pm

Re: HELP! How to make a dll available for Love2D ?

Post by I~=Spam »

dracula004 wrote:The source was already attached in former post.

I'm trying to build that dll with vs.
I downloaded the source before (and just now) and there are no c or c++ files in there. Can you post the C/C++ source (not just lua) The .dll file is not really any help.
My Tox ID: 0F1FB9170B94694A90FBCF6C4DDBDB9F58A9E4CDD0B4267E50BF9CDD62A0F947E376C5482610
Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 2 guests