Page 1 of 1

HelloWorld_Android doesn't build

Posted: Fri May 19, 2017 12:26 am
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?

Re: HelloWorld_Android doesn't build

Posted: Fri May 19, 2017 7:28 am
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)
 

Re: HelloWorld_Android doesn't build

Posted: Fri May 19, 2017 6:32 pm
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.