HelloWorld_Android doesn't build

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Agent_X
Posts: 41
Joined: Sun Sep 16, 2012 3:44 am

HelloWorld_Android doesn't build

Post by Agent_X »

The Irrlicht library builds fine using ndk-build. In <my-repo>/source/Irrlicht/Android/obj/local/ the following directories are created:

arm64-v8a
armebi
armeabi-v7a
mips
mips64
x86
x86_64

In each of these directories is the libIrrlicht.a file (among other things).

In <my-repo>/lib/Android/ is a version of the libIrrlicht.a file. By comparing the size of this lib file with the ones mentioned above it seems to be the same one from either the armeabi-v7a or mips directory.

Now for my problem. When I attempt step 4 under section BUILDING Irrlicht & your App of the readme.txt file in <my-repo>/examples/01.HelloWorld_Android/ I get the following error:

Code: Select all

jni/../jni/../../../lib/Android/libIrrlicht.a: error adding symbols: File in wrong format
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [obj/local/arm64-v8a/libHelloWorldMobile.so] Error 1
 
It seems like it is trying to build for every target platform, but using the wrong version of libIrrlicht.a. Do I need to edit Android.mk or Application.mk or something?
kornwaretm
Competition winner
Posts: 189
Joined: Tue Oct 16, 2007 3:53 am
Location: Indonesia
Contact:

Re: HelloWorld_Android doesn't build

Post by kornwaretm »

i guess you build on windows. just change the path of the lib to irrlicht_ogl_es\source\Irrlicht\Android\obj\local\ ARC_ABI \ irrlicht.a
or manually ad a copy command to copy the desired lib file to the folder

Code: Select all

 
include $(CLEAR_VARS)
LOCAL_MODULE := Irrlicht
LOCAL_SRC_FILES := $(IRRLICHT_PATH)\source\Irrlicht\Android\obj\local\$(TARGET_ARCH_ABI)\libIrrlicht.a
include $(PREBUILT_STATIC_LIBRARY)
 
Agent_X
Posts: 41
Joined: Sun Sep 16, 2012 3:44 am

Re: HelloWorld_Android doesn't build

Post by Agent_X »

Ok after refusing to give up (because I was able to build my project for Android a year ago!) I searched and searched and found this guide:

https://www.sitepoint.com/using-c-and-c ... h-the-ndk/

I thought it might help others, so there it is.
Post Reply