I'm learning to create gideros plugins using "Creating plugins for Android in Gideros" tutorial.
I'm not familiar with c++ building etc. After hours of trials and errors I figured out that I can build normally for armeabi and armeabi-v7a, but fail to build for x86.
[x86] Compile++ : exampleplugin <= exampleplugin.cpp
[x86] Prebuilt : libgideros.so <= jni/../../libs/armeabi/
[x86] SharedLibrary : libexampleplugin.so
/Applications/ndk/toolchains/x86-4.6/prebuilt/darwin-x86_64/bin/../lib/gcc/i686-linux-android/4.6/../../../../i686-linux-android/bin/ld: error: ./obj/local/x86/libgideros.so: incompatible target
/Applications/ndk/toolchains/x86-4.6/prebuilt/darwin-x86_64/bin/../lib/gcc/i686-linux-android/4.6/../../../../i686-linux-android/bin/ld: ./obj/local/x86/objs/exampleplugin/exampleplugin.o: in function luaopen_plugin(lua_State*):jni/exampleplugin.cpp:40: error: undefined reference to 'luaL_register'
... and much more lines
So the ndk builder can't work with gideros x86 library?
How can I solve this problem? Thanks!
Comments
APP_ABI := armeabi armeabi-v7a x86
to Application.mk
It seems that you simply don't have or have incorrect gideros x86 binaries
So I've come to a wrong conclusion that I can't build for x86. I couldn't build for x86 and was able to build for arme and arme7va, because I used a mix of old libraries from the example projects (that doesn't contain libraries for x86) and new libraries from my own gideros project (only x86 libs).
With old libraries I can build both the example project and my own gideros project, but with new - neither of them.
So what am I doing wrong? Is it ok to build with old libraries (sept 2012)? And what should I do to be able to build for x86? I've reinstalled gideros studio and ndk, but that didn't help.
To build plugins to new Gideros, you need to change your Android.mk file a bit.
Basically the changes are that there are now more binaries to linked
And of course you must be linking to new binaries and new header files from new Gideros SDK in all the provided paths.
Something like this should work now (changing to your own paths of course)
Oh and if you dont target ARMv6, just remove APP_ABI for armeabi - ARMv7 is majority right now
http://www.nightspade.com
I never really did building any .so files
All what i do is change any existing plugin at Gideros,
for example ads-interface, there is "getWidth()" which i never used, i then overwrite that one for any thing that i want, for example to get battery status.
And for naming, i override that at lua (to make sure i remember it right) :
function getBatteryStatus()
return admob:getWidth()
end
Also, if i want some thing like dispatch event, i then change AdsError() which somehow never really fired anyway.
Probably this is weird, but i find out that it works and super easy, so yeah...
And i did this also for iOS.
)
Likes: ar2rsawseen, Nascode
Maybe need to create some generic dummy plugin with lots of functions and events, just so it could be used that way
Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
Cool Vizify Profile at https://www.vizify.com/oz-apps
admob:showAd("twitter")
People who see this would goes 'What!?'
)
Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
Cool Vizify Profile at https://www.vizify.com/oz-apps
@tkhnoman @ar2rsawseen
Generic plugin so we could avoid building .so :P
http://www.nightspade.com
at every new version i spend 1-2 hours while i manage to set up and build correctly my plugin.
also, if i've built an so, if a new version comes isn't it enough to just copy this .so and the java file in the src (with the plugin binding)? i never tried this, wouldn't this work?
Fragmenter - animated loop machine and IKONOMIKON - the memory game
http://www.nightspade.com
Fragmenter - animated loop machine and IKONOMIKON - the memory game