AndroidGuiExample failed compiling - android

I'm trying to get acquainted with openFrameworks and Android application. I installed both Android SDK and NDK (r10e) and I tried to compile the AndroidGuiExample.
Unfortunately, this is what the terminal returned at the end:
undefined reference to 'std::__throw_out_of_range_fmt(char const*, ...)'
collect2: error: ld returned 1 exit status
make[2]: *** [libs/armeabi-v7a/libOFAndroidApp.so] Error 1
make[1]: *** [Debug] Error 2
make: *** [AndroidDebug] Error 2
I have not sincerely a clear idea of what happened.
Anyone could help me in understanding the error and finding a solution?
Thanks everyone!

Have you configured NDK ?
With a text editor, edit the file
libs/openFrameworksCompiled/project/android/paths.make
and set the NDK path to the correct folder:
NDK_ROOT=/path/to/the/ndk
So it looks like this
NDK_ROOT=/Developer/android-ndk-r10e
happy coding ! :)

Related

Compiling Facebook Redex on OSX Yosemite

So I installed redex on Ubuntu last night and everything went smoothly.
I'm having trouble today setting it up on my Mac.
There are 3 errors I'm getting at this autoreconf -ivf && ./configure && make && make install step.
Please install double-conversion library
Please install google-glog library
Please install google-gflags library
I dont get these all at once. I got the first one so I followed the solution here but that didn't work so I just deleted that check from the configure.ac file. This led to the second error, which then led to the 3rd.
I'm not sure why this is happening, I followed the exact same steps as I did last night.
Any suggestions?
So I followed the suggestion from Ralph and now I've got a different error -
...
"double_conversion::StringToDoubleConverter::StringToIeee(char const*, int, int*, bool) const", referenced from:
folly::detail::str_to_float(folly::Range<char const*>*) in libfolly.a(Conv.o)
folly::detail::str_to_double(folly::Range<char const*>*) in libfolly.a(Conv.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [redex-all] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
you have to do the following steps
xcode-select --install and brew link --force openssl
after that add #include <stddef.h> line into third-party/folly/folly/portability/Malloc.h
see this post
Looks like there were bugs in the code that needed to get ironed out. The fun of early adopters ;)
https://github.com/facebook/redex/commits/master
It's working for me now.

Android cmake cannot find -lpthread

I'm trying to compile a shared library using cmake. I followed the instruction on this tutorial to change the toolchain for android NDK.
However, I'm getting the following output error:
/home/usr/android-toolchain/bin/../lib/gcc/arm-linux-androideabi/4.9/../../../../arm-linux-androideabi/bin/ld: error: cannot find -lpthread
collect2: error: ld returned 1 exit status
make[2]: *** [../libs/armeabi-v7a/libutils.so] Error 1
make[1]: *** [src/CMakeFiles/utils.dir/all] Error 2
make: *** [all] Error 2
A bit of googling around and I stumble upon this stackoverflow post. So I modified my CMakeLists.txt to add:
set(CMAKE_CXX_FLAGS"-DHAVE_PTHREADS")
but it seems like it still doesn't work. Am I going about this the wrong way?
Thanks!

Building ogre for android ndk10

Sorry I may added it as another topic but I get a different error. Now I have the dependencies installed from the repository. I'm trying to build for Android.
I use Mingw32
now I get the following error:
[armeabi-v7a] SharedLibrary : libOgreSampleBrowser.so
C:/ogre/AndroidDependencies/lib/armeabi-v7a/libFreeImage.a(libraw_datastream.c
.o):libraw_datastream.cpp:function LibRaw_bigfile_datastream::get_char(): erro
undefined reference to '__srget'
collect2.exe: error: ld returned 1 exit status
make.exe[3]: *** [obj/local/armeabi-v7a/libOgreSampleBrowser.so] Error 1
Samples\Browser\CMakeFiles\SampleBrowserDummy.dir\build.make:84: recipe for ta
et 'lib/libSampleBrowserDummy.so' failed
mingw32-make[2]: *** [lib/libSampleBrowserDummy.so] Error 2
CMakeFiles\Makefile2:3749: recipe for target 'Samples/Browser/CMakeFiles/Sampl
rowserDummy.dir/all' failed
mingw32-make[1]: *** [Samples/Browser/CMakeFiles/SampleBrowserDummy.dir/all] E
or 2
Makefile:136: recipe for target 'all' failed
I encountered the same error...
Google removed __srget starting from NDKr10c (check their official site in other fixed bugs).
Download r10b and below and it should work.

Error compiling iptables using cygwin on android

I am using my iptables source from https://code.google.com/p/iptables4n1/ because source from netfilter.org has issues compiling using cygwin.
When I run the ndk-build from my cmd(Am using windows) the build process runs smoothly until it throws an error. Below is the cmd output of the error.
C:/Users/Chike/Desktop/DevSec/android-ndk-r9b/toolchains/arm-linux-androideabi-4
.6/prebuilt/windows-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../
arm-linux-androideabi/bin/ld.exe: ./obj/local/armeabi/objs/iptables/iptables-sta
ndalone.o: in function main:jni/iptables-standalone.c:62: error: undefined refer
ence to 'init_extensions'
collect2: ld returned 1 exit status
make.exe: *** [obj/local/armeabi/iptables] Error 1
Anyone with solution?

"cannot open linker script file" when compiling GameKit for Android

When I built Gamekit for Android, I got the follow error:
...(deleted)
[ 98%] Built target OgreKitCore
Linking CXX executable ../../../bin/StripBlend
/usr/local/android-ndk-r8b/toolchains/mipsel-linux-android-4.6/prebuilt/linux-x86/bin/../lib/gcc/mipsel-linux-android/4.6.x-google/../../../../mipsel-linux-android/bin/ld: cannot open linker script file /usr/local/android-ndk/toolchains/mipsel-linux-android-4.6/mipself.x: No such file or directory
collect2: ld returned 1 exit status
make[2]: *** [../bin/StripBlend] Error 1
make[1]: *** [FileTools/Strip/CMakeFiles/StripBlend.dir/all] Error 2
make: *** [all] Error 2
I google it and found a related post:
https://groups.google.com/forum/#!msg/doubango/TVOUjTxfbtA/y6eaikfcTu0J
They just rollback NDK version to fix this problem.
However, I have to build an Android Gamekit library for MIPS CPU, so I need NDK-r8 or NDK-r8b.
Is there any suggestion to fix this problem?
PS: GameKit is http://code.google.com/p/gamekit/
Copy mipself.x and mipself.xsc, which can be downloaded from the Internet,
into /toolchains/mipsel-linux-android-4.6/ folder, and then fix this problem.

Categories

Resources