Setup OpenFrameworks for Android on Windows 7

Hello everybody,
I want to install OF for Android on My Windows 7 machine and Eclipse IDE V 4.2.

I followed the instructions in http://www.multigesture.net/articles/how-to-setup-openframeworks-for-android-on-windows/

but I recieve the following errors upon build:
**recipe for target `AndroidRelease’ failed Makefile.android /libs/openFrameworksCompiled/project/makefileCommon line 93
**

and
**recipe for target `AndroidDebug’ failed Makefile.android /libs/openFrameworksCompiled/project/makefileCommon line 90
**

When I run an app from the examples (Polygon app) I receive the following exception from the LogCat:
java.lang.UnsatisfiedLinkError: Couldn’t load OFAndroidApp: findLibrary returned null

How can I solve this ?
Thanks

Hi Minasamy,

I forwarded this post to some of the android devs. Hopefully you should get an answer soon.

Are you using Android NDK r8b? - if you’re using r8c then OF won’t currently work.

Theo

Hi Theo

thanks for your help.
I managed to get over this by cloning a fresh copy of the **development **branch and installing a fresh copy of Eclipse.
I followed the steps in the guide and got if finally to build and run

Thanks

Thats great news. Thanks for letting us know.
We’re really working on getting the Android setup easier and less painful.

All the best,
Theo

Hello,

I have also followed this tutorial but I cannot compile OpenFrameworks. While building the project it gets stuck somewere. Here is the console output:

19:58:26 **** Build of configuration Android for project openFrameworks ****
make -C …/openFrameworksCompiled/project/android -j4 -j2 android
make: Entering directory /c/openFrameworks/libs/openFrameworksCompiled/project/android' make DebugAndroid make[1]: Entering directory/c/openFrameworks/libs/openFrameworksCompiled/project/android’
compiling object for …/…/…/openFrameworks/3d/of3dUtils.cpp
mkdir -p obj/DebugAndroid/openFrameworks/3d
C:/Development/android-ndk-r8b/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/arm-linux-androideabi-g++ -g3 -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -nostdlib --sysroot=C:/Development/android-ndk-r8b/platforms/android-8/arch-arm/ -fno-short-enums -frtti -fexceptions -I"C:/Development/android-ndk-r8b/platforms/android-8/arch-arm/usr/include/" -I"C:/Development/android-ndk-r8b/sources/cxx-stl/gnu-libstdc++/include" -I"C:/Development/android-ndk-r8b/sources/cxx-stl/gnu-libstdc++/4.6/include" -I"C:/Development/android-ndk-r8b/sources/cxx-stl/gnu-libstdc++/libs/armeabi/include" -I"C:/Development/android-ndk-r8b/sources/crystax/include/" -I"C:/Development/android-ndk-r8b/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi/include" -DANDROID -Wall -fexceptions -I…/…/…/FreeImage/include -I…/…/…/assimp/include -I…/…/…/assimp/include/Compiler -I…/…/…/cairo/include -I…/…/…/cairo/include/cairo -I…/…/…/cairo/include/libpng15 -I…/…/…/cairo/include/pixman-1 -I…/…/…/fmodex/include -I…/…/…/freetype/include -I…/…/…/freetype/include/freetype2 -I…/…/…/freetype/include/freetype2/freetype -I…/…/…/freetype/include/freetype2/freetype/config -I…/…/…/freetype/include/freetype2/freetype/internal -I…/…/…/freetype/include/freetype2/freetype/internal/services -I…/…/…/glew/include -I…/…/…/glew/include/GL -I…/…/…/kiss/include -I…/…/…/portaudio/include -I…/…/…/rtAudio/include -I…/…/…/tess2/include -I…/…/…/videoInput/include -I…/…/…/poco/include -I…/…/…/glu/include_android -I…/…/…/…/addons/ofxAndroid/src -I…/…/…/openFrameworks/ -I…/…/…/openFrameworks/.settings -I…/…/…/openFrameworks/3d -I…/…/…/openFrameworks/app -I…/…/…/openFrameworks/communication -I…/…/…/openFrameworks/events -I…/…/…/openFrameworks/gl -I…/…/…/openFrameworks/graphics -I…/…/…/openFrameworks/math -I…/…/…/openFrameworks/sound -I…/…/…/openFrameworks/types -I…/…/…/openFrameworks/utils -I…/…/…/openFrameworks/video -MMD -MP -MFobj/DebugAndroid/openFrameworks/3d/of3dUtils.d -MTobj/DebugAndroid/openFrameworks/3d/of3dUtils.o -o obj/DebugAndroid/openFrameworks/3d/of3dUtils.o -c …/…/…/openFrameworks/3d/of3dUtils.cpp
compiling object for …/…/…/openFrameworks/3d/ofCamera.cpp
mkdir -p obj/DebugAndroid/openFrameworks/3d
C:/Development/android-ndk-r8b/toolchains/arm-linux-androideabi-4.6/prebuilt/windows/bin/arm-linux-androideabi-g++ -g3 -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -nostdlib --sysroot=C:/Development/android-ndk-r8b/platforms/android-8/arch-arm/ -fno-short-enums -frtti -fexceptions -I"C:/Development/android-ndk-r8b/platforms/android-8/arch-arm/usr/include/" -I"C:/Development/android-ndk-r8b/sources/cxx-stl/gnu-libstdc++/include" -I"C:/Development/android-ndk-r8b/sources/cxx-stl/gnu-libstdc++/4.6/include" -I"C:/Development/android-ndk-r8b/sources/cxx-stl/gnu-libstdc++/libs/armeabi/include" -I"C:/Development/android-ndk-r8b/sources/crystax/include/" -I"C:/Development/android-ndk-r8b/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi/include" -DANDROID -Wall -fexceptions -I…/…/…/FreeImage/include -I…/…/…/assimp/include -I…/…/…/assimp/include/Compiler -I…/…/…/cairo/include -I…/…/…/cairo/include/cairo -I…/…/…/cairo/include/libpng15 -I…/…/…/cairo/include/pixman-1 -I…/…/…/fmodex/include -I…/…/…/freetype/include -I…/…/…/freetype/include/freetype2 -I…/…/…/freetype/include/freetype2/freetype -I…/…/…/freetype/include/freetype2/freetype/config -I…/…/…/freetype/include/freetype2/freetype/internal -I…/…/…/freetype/include/freetype2/freetype/internal/services -I…/…/…/glew/include -I…/…/…/glew/include/GL -I…/…/…/kiss/include -I…/…/…/portaudio/include -I…/…/…/rtAudio/include -I…/…/…/tess2/include -I…/…/…/videoInput/include -I…/…/…/poco/include -I…/…/…/glu/include_android -I…/…/…/…/addons/ofxAndroid/src -I…/…/…/openFrameworks/ -I…/…/…/openFrameworks/.settings -I…/…/…/openFrameworks/3d -I…/…/…/openFrameworks/app -I…/…/…/openFrameworks/communication -I…/…/…/openFrameworks/events -I…/…/…/openFrameworks/gl -I…/…/…/openFrameworks/graphics -I…/…/…/openFrameworks/math -I…/…/…/openFrameworks/sound -I…/…/…/openFrameworks/types -I…/…/…/openFrameworks/utils -I…/…/…/openFrameworks/video -MMD -MP -MFobj/DebugAndroid/openFrameworks/3d/ofCamera.d -MTobj/DebugAndroid/openFrameworks/3d/ofCamera.o -o obj/DebugAndroid/openFrameworks/3d/ofCamera.o -c …/…/…/openFrameworks/3d/ofCamera.cpp
In file included from …/…/…/openFrameworks/types/ofRectangle.h:14:0,
from …/…/…/openFrameworks/graphics/ofGraphics.h:7,
from …/…/…/openFrameworks/3d/of3dUtils.cpp:2:
…/…/…/openFrameworks/utils/ofLog.h:150:15: note: the mangling of ‘va_list’ has changed in GCC 4.4
In file included from …/…/…/openFrameworks/types/ofRectangle.h:14:0,
from …/…/…/openFrameworks/3d/ofCamera.h:20,
from …/…/…/openFrameworks/3d/ofCamera.cpp:10:
…/…/…/openFrameworks/utils/ofLog.h:150:15: note: the mangling of ‘va_list’ has changed in GCC 4.4

Eclipse also shows this message: Build project (59%).

But it has been like this for hours. Any clue of how to solve this??

Thanks!

Hey Joan,

Yesterday I was trying to setup openframeworks android in windows/eclipse. But i am stuck when building. Got same output like yours. It never finish. Did you find a solution for this?

Thanks

Hey all,

I haven’t checked my guide with the latest version of OF yet, could you specify which versions you’re using?

  • OF version (stable or dev-branch from github)
  • ADT versions?
  • MSYS/MINGW version?

OF version -> the one from the tutorial (gitHub) http://www.multigesture.net/articles/how-to-setup-openframeworks-for-android-on-windows/

ADT Version -> 21.0.1 (I downloaded de ADT plugin from eclipse)

MSYS/MINGW version 20120426

I realised something: When you stop building OF some of the files are created in the folder openFrameworks compiled. If you start again, it starts building from where it stopped, and going on and on I could compile all the library until having the files specified in the tutorial:

armeabi\libopenFrameworks.a
armeabi\libopenFrameworksDebug.a
armeabi-v7a\libopenFrameworks.a
armeabi-v7a\libopenFrameworks_arm7.a

I dont know if there is something wrong with this, but I can compile and run the examples, though I am having some trouble when I try to do something on my own, maybe because I’m not used to use OF with Android and I dont know how it works yet… I’ll keep on trying!

I cannot get rid of this error when I compile an app for android either, although I can run the examples anyways:

Description Resource Path Location Type
BFD (GNU Binutils) 2.21 assertion fail /usr/local/google/home/andrewhsieh/ndk-andrewhsieh/src/build/…/binutils/binutils-2.21/bfd/elf32-arm.c:10190 androidEmptyExample C/C++ Problem

Right, if you have all the *.a lib files then openFrameworks compiled just fine I guess. At least enough to get the examples going.

You can safely ignore the binutil error messages, I get those too and I believe it depends on the compiler/utils used from the NDK ( http://code.google.com/p/android/issues/detail?id=35209 ).

Hello,

I downloaded Openframeworks from github (https://github.com/openframeworks/openFrameworks)
My Eclipse is Juno 4.2.1 with CDT,
Android SDK Manager Revision 21.1
NDK r8b
ANT 1.8.4

When i try to build, same files apper in “\of\libs\openFrameworksCompiled\project\android\obj” in there folders

DebugAndroid
ReleaseAndroid
Release_arm7Android

Its OK i guess but the only problem is each time i try to click hammer only 2 or 4 files are created in these folders and stuck. I have to cancel process and click to hammer again. Is that normal?

Also 4 necessary files you are talking about in “of\libs\openFrameworksCompiled\lib\android” are created.

So i tried to run empty example and gets the error:

19:03:56 **** Incremental Build of configuration AndroidRelease for project androidPolygonExample ****
make AndroidRelease
FIND: Parameter format not correct
File not found - “*.c”
FIND: Parameter format not correct
File not found - “*.c”
make ReleaseAndroid
FIND: Parameter format not correct
File not found - “*.c”
FIND: Parameter format not correct
File not found - “*.c”
FIND: Parameter format not correct
File not found - “*.c”
make[1]: Entering directory /d/backup/software/Development/of/examples/android/androidPolygonExample' linking android libs/armeabi/libOFAndroidApp.so android/armeabi mkdir -p libs/armeabi D:/backup/software/Development/android-ndk-r8b/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin/arm-linux-androideabi-g++ -o libs/armeabi/libOFAndroidApp.so --sysroot=D:/backup/software/Development/android-ndk-r8b/platforms/android-8/arch-arm/ -nostdlib -L"D:/backup/software/Development/android-ndk-r8b/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi" -fuse-ld=gold -Wl,--fix-cortex-a8 -shared -Wl,--no-undefined ../../../libs/openFrameworksCompiled/lib/android/armeabi/libopenFrameworks.a ../../../libs/poco/lib/android/armeabi/libPocoNet.a ../../../libs/poco/lib/android/armeabi/libPocoXML.a ../../../libs/poco/lib/android/armeabi/libPocoFoundation.a ../../../libs/FreeImage/lib/android/armeabi/libfreeimage.a ../../../libs/freetype/lib/android/armeabi/libfreetype.a ../../../libs/glu/lib/android/armeabi/libGLU.a ../../../libs/tess2/lib/android/armeabi/libtess2.a -L../../../libs/FreeImage/lib/android/armeabi -L../../../libs/freetype/lib/android/armeabi -L../../../libs/glu/lib/android/armeabi -L../../../libs/openFrameworksCompiled/lib/android/armeabi -L../../../libs/poco/lib/android/armeabi -L../../../libs/tess2/lib/android/armeabi -lsupc++ -lz -lGLESv1\_CM -llog -ldl -lm -lc D:/backup/software/Development/android-ndk-r8b/sources/cxx-stl/gnu-libstdc++/4.6/libs/armeabi/libgnustl\_static.a -lgcc collect2: cannot find 'ld' make[1]: \*\*\* [libs/armeabi/libOFAndroidApp.so] Error 1 make[1]: Leaving directory/d/backup/software/Development/of/examples/android/androidPolygonExample’
make: *** [AndroidRelease] Error 2

Ok I give up,
Thanks anyway.

Hi,

just a small update. Since I got a new machine I reinstalled everything and actually got the same issue where it would get stuck during building.

It appears to be an issue with the latest MinGW/MSys, if I copy over the old MinGW from my laptop, it works just fine. Why it happens I dont know yet but a way to at least get the libs building is to remove the -j4 parameter in the Build command of the openFrameworks project in Eclipse.

After removing, it should compile just fine.