Page 1 of 1
External Libraries with Love Android
Posted: Fri Jan 13, 2017 12:00 am
by MelloLunar
Hello, I would like to know how I can run external libraries on android,
I installed libraries using luarocks on my PC, then I copied the files into my directory inside a lib/ folder and changed the requirepath and cpath, I then sent my files to mobile using an FTP server and opened the lua file with Love for Android (Or whatever it was called) using X-plore app, now it worked fine on my PC but when I opened my libraries (the .so files, to be more precise), it told me that the infrastructure was different (arm compared to x86_64) and it just didn't run
How would I go about making libraries such as lpeg or cqueues work on android? Thank you for reading ...
Re: External Libraries with Love Android
Posted: Fri Jan 13, 2017 12:28 am
by raidho36
Well of course you can't run x86 binary code on ARM processor, the same way you can't run PlayStation games on XBox - it's pretty basic thing to know about cross platform distribution, that each platform requires its own build. What you need to do is download source code for your packages and build them as Android-compatible ARM Shared Object files, that'll produce .so files that can be loaded on Android.
Re: External Libraries with Love Android
Posted: Fri Jan 13, 2017 12:50 am
by MelloLunar
raidho36 wrote:Well of course you can't run x86 binary code on ARM processor, the same way you can't run PlayStation games on XBox - it's pretty basic thing to know about cross platform distribution, that each platform requires its own build. What you need to do is download source code for your packages and build them as Android-compatible ARM Shared Object files, that'll produce .so files that can be loaded on Android.
What compiler would build them as arm shared objects that would be compatible with android? Also, what about the dependencies of libraries such as openssl or the configuration that is related to arm environments and demanded by those compilers
I went that way, but because I really was going in blind, my results were mediocre and I had to deal with a lot of problems... Now... if someone else managed to do it themselves, that's another story...
Re: External Libraries with Love Android
Posted: Fri Jan 13, 2017 1:00 am
by raidho36
Android SDK and NDK should have everything you need to build your files. If you build from source code, dependencies you'll of course have to resolve yourself. The sure way to do this is to place dependencies in a sub-folder and include them in build list, to hard-embed them into your binaries.
But do try your luck with web search about having luarocks to build for Android.
Re: External Libraries with Love Android
Posted: Sat Jan 14, 2017 7:12 am
by Positive07
Similarly, you could statically link the libraries to the APK, for examples just check how LuaSocket and Lua-ENET are statically linked to LÖVE