Integrate blockchain related libraries

Thank for your answer ! Basically what i just did, and correct me if i am wrong, i used Visual Studio Developer Command Prompt to generate the .dll file.
This is what i entered in Visual Studio Developer Command Prompt i the src folder of the library:

del *.obj *.dll *.lib *.o *.exp
cl -MP -MD -O2 -c -DLUA_BUILD_AS_DLL *.c
ren luac.obj luac.o
link -subsystem:console -dll -implib:lua53.lib -out:lua53.dll *.obj
link -out:lua.exe lua.obj lua53.lib
lib -out:lua53-static.lib *.obj
link -out:luac.exe luac.o lua53-static.lib

i got now a bunch of files between then there is my .dll file.

What should i do next to integrate it in my extension. sorry for asking but i did not really get the part about the symbol visibility and dlopen()

I get the feeling that you are in over your head with this. I still think that your best bet would be to start with the native extension from the example/manual and modify that to bring in and bind the code you have to the Lua version provided by Defold. If you are comfortable coding in C/C++ then that shouldn’t be much of a problem for you. I’m not sure about the approach with a dynamic library and another Lua version. How do you plan to interact with the code from the library in the scripts of your Defold game?

1 Like

Also, there is no dll-support on iOS.

Oh yeahhh !! very much over !! HAHAHAHA !!

I am very much comfortable coding in C/C++.

Step1:
Is there a way to find the equivalent functions in Defold engine compared to Lua 5.3.0 library which is needed for Steemlua to be able to run? In this way i would just replace all the lua5.3.0 library calls to the equivalent Defold functions.

Step2:
how should i implement the calls to defold functions ?
where should i implement them (in the root ? should i implement them as a separate script in the native extension ?)

Thanks for the answers

Which functions are you referring to?
Do compare with lua 5.1 to see if you find discrepancies

how should i implement the calls to defold functions ?
where should i implement them (in the root ? should i implement them as a separate script in the native extension ?)

First off, have you tried the miinimal example?
That should give you the first hint on how to communicate between Lua <-> C.
The gist of it is that you register a new Lua module to the engine. You decide on what functions it contains.
From the Defold scripting side, you’ll call your new functions from within the script life cycle functions.

I see that making this library work will require lot of work and time.
Lot of things changed between Lua 5.1 and Lua 5.3 which makes adapting things a bit messy, at least for me.
To “simplify” things i might do all the things related to steem blockchain (login, authentication, etc…) happen on server side where i could implement them in a much direct way without workarounds.

Thank you all for your suggestions !

1 Like