Decent tutorial for making c++ dll compatible w/ lua/love2d?

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
User avatar
RonanZero
Citizen
Posts: 90
Joined: Mon Oct 20, 2014 3:33 am

Decent tutorial for making c++ dll compatible w/ lua/love2d?

Post by RonanZero »

I already have my C++ function ready to go and I looked up how to actually make it work in Lua and it is extremely complicated, I can't figure out what I have to do to just run a function in C++ that returns an int to Lua. I already did the include things that I have to do to get it to work with Lua. But I just get so many errors. So is there a decent, thorough tutorial for making a c++ dll compatible with lua?
while true do end;
User avatar
I~=Spam
Party member
Posts: 206
Joined: Fri Dec 14, 2012 11:59 pm

Re: Decent tutorial for making c++ dll compatible w/ lua/lov

Post by I~=Spam »

I don't have a "tutorial" for you but I did make a simple library that is compatible with LOVE on Linux and Windows (I have no idea if it will work on OSX) with cmake. :)

Here it is: https://github.com/GoogleBot42/IronBox

The important files and folders is the "CMakeLists.txt" for cmake and the c_src directory. The lib directory in the c src is for storing the 32bit and 64bit lib files needed to compile on windows. On Linux lua just needs to be be installed and gcc or clang will be able to find it. ;)

BTW are you by chance taking my suggestion to write the anti-pirating code in c/c++ as I suggested in another thread? Unfortunately, if this is what you are doing I do not think it is not a good idea. A pirater could easily remove the "require" needed to load the lib and can the code to remove the pirating checks. It might be slightly better to build LOVE itself with the checks built-in and run the check before the lua code is even run but then the pirater could copy the lua code out of the executable with a zip program and run that with a normal version of LOVE.
My Tox ID: 0F1FB9170B94694A90FBCF6C4DDBDB9F58A9E4CDD0B4267E50BF9CDD62A0F947E376C5482610
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests