i get many undefined reference errors when i code opencv under android NDK, such as:
system.cpp:(.text.unlikely._ZNSs4_Rep10_M_disposeERKSaIcE.part.5+0x1c):
undefined reference to `std::string::_Rep::_M_destroy(std::allocator
const&)'
G:/AndroidProjects/SprayingPrjJNI/app/src/main/cpp/../jniLibs/arm64-v8a/libopencv_core.a(system.cpp.o):
In function `void std::_Destroy(std::string*, std::string*,
std::allocator&) [clone .isra.88]':
system.cpp:(.text.unlikely._ZSt8_DestroyIPSsSsEvT_S1_RSaIT0_E.isra.88+0x18):
undefined reference to `std::string::_Rep::_S_empty_rep_storage'
system.cpp:(.text.unlikely._ZSt8_DestroyIPSsSsEvT_S1_RSaIT0_E.isra.88+0x2c):
undefined reference to `std::string::_Rep::_S_empty_rep_storage'
..................
i really dont know how to fix these errors, please help me, thanks
See NDK - problems after GNUSTL has been removed from the NDK (revision r18).
But if you don't have very strong reasons to stay with the old version of OpenCV, the easiest approach is to switch to prebuilt OpenCV 4.01 which is compatible with NDK r19.
Related
I try to develop an Android app using Gstreamer. I use Fedora 20 with installed Eclipse with ADT and NDT, Android SDK and NDK, gstreamer SDK for Android. But something goes wrong, when I try to build tutorials.
Everything is OK, when I build NDK samples (like hello-jni), but building is not complited working with samples from gstreamer SDK (definitely it is android-tutorial-1 from [gstreamer sdk installation]/share/gst-sdk/tutorials/). Here is what i see in log:
13:13:10 **** Auto Build of configuration Default for project Tutorial1 ****
/home/staslatgttt/work/android-ndk-r10c/ndk-build all
GStreamer : [GEN] => gst-build/gstreamer_android.c
GStreamer : [COMPILE] => gst-build/gstreamer_android.c
GStreamer : [LINK] => gst-build/libgstreamer_android.so
/home/staslatgttt/work/android-ndk-r10c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.gold: /home/staslatgttt/work/gstreamer-sdk-android-arm-debug-2013.6//lib/libgstreamer-0.10.a(libgstparse_la-lex.priv_gst_parse_yy.o): in function priv_gst_parse_yylex:lex.priv_gst_parse_yy.c:1598: error: undefined reference to '__srget'
/home/staslatgttt/work/android-ndk-r10c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.gold: /home/staslatgttt/work/gstreamer-sdk-android-arm-debug-2013.6//lib/libglib-2.0.a(libcharset_la-localcharset.o): in function _g_locale_get_charset_aliases:localcharset.c:158: error: undefined reference to '__srget'
/home/staslatgttt/work/android-ndk-r10c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.gold: /home/staslatgttt/work/gstreamer-sdk-android-arm-debug-2013.6//lib/libglib-2.0.a(libcharset_la-localcharset.o): in function _g_locale_get_charset_aliases:localcharset.c:167: error: undefined reference to '__srget'
/home/staslatgttt/work/android-ndk-r10c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.gold: /home/staslatgttt/work/gstreamer-sdk-android-arm-debug-2013.6//lib/libintl.a(localcharset.o): in function locale_charset:./localcharset.c:195: error: undefined reference to '__srget'
/home/staslatgttt/work/android-ndk-r10c/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.gold: /home/staslatgttt/work/gstreamer-sdk-android-arm-debug-2013.6//lib/libintl.a(log.o): in function __sputc:/home/slomo/Projects/android/android-ndk-r8e/toolchains/arm-linux-androideabi-4.7/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.7/include-fixed/stdio.h:376: error: undefined reference to '__swbuf'
collect2: ld returned 1 exit status
make: *** [buildsharedlibrary] Error 1
13:13:11 Build Finished (took 972ms)
I tried to surf Internet, but I didn't find useful explanation how to solve this problem. All I understood is that problem is connected to Gold Linker. Only on this site http://docs.gstreamer.com/display/GstSDK/Installing+for+Android+development is a small tip about problems with Gold Linker on Windows, but I use Linux! Anyway, if I wanted to solve this problem on Windows, "this project" link mentioned there is not avaliable.
Can anyone help me with this? I don't know, what I do wrong, but I really need to solve this problem.
The NDK r10c wasn't support till 11-10-2014.
"The Android binaries are now built with the r10c NDK and as such binary compatible again with all NDK and Android releases" - http://gstreamer.freedesktop.org/
Try it again with the latest NDK and GStreamer Android SDK.
I encountered the same error... Google removed __srget starting from NDKr10c (check their official site in other fixed bugs). Downgrade to r10b or below and it should work.
Setup is according to given in Github/FacebookSDK and every thing is just fine,
but when run command apportable build it gives error like this
.../Source/AppDelegate.m:function L_OBJC_CLASSLIST_REFERENCES_$_125: error: undefined reference to 'OBJC_CLASS_$_FBSession'
.../Source/EndGame.m:function L_OBJC_CLASSLIST_REFERENCES_$_125: error: undefined reference to 'OBJC_CLASS_$_FBSession'
.../Source/EndGame.m:function L_OBJC_CLASSLIST_REFERENCES_$_147: error: undefined reference to 'OBJC_CLASS_$_FBRequest'
.../Source/EndGame.m:function L_OBJC_CLASSLIST_REFERENCES_$_257: error: undefined reference to 'OBJC_CLASS_$_FBRequestConnection'
what i am doing wrong ?
thanks
Apportable starter SDK version does not support Facebook ios SDK compilation. You must have an Indie Version to have support for social media SDKs.
I want to develop and android application which will help annotate the PDF files in android. Thus, I am using MuPDF to read and Parse the PDF files in android. I am trying to build it as specified in http://www.mupdf.com/doc/how-to-build-mupdf-for-android , but I have encountered the following error:
C:/Android-NDK/android-ndk/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-v7a/libmupdfcore.a(image.o): in function fz_decomp_image_from_stream:jni/../../../source/fitz/image.c:182: error: undefined reference to 'fz_unpack_tile'
C:/Android-NDK/android-ndk/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-v7a/libmupdfcore.a(image.o): in function fz_decomp_image_from_stream:jni/../../../source/fitz/image.c:193: error: undefined reference to 'fz_decode_indexed_tile'
C:/Android-NDK/android-ndk/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-v7a/libmupdfcore.a(image.o): in function fz_decomp_image_from_stream:jni/../../../source/fitz/image.c:200: error: undefined reference to 'fz_decode_tile'
C:/Android-NDK/android-ndk/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-v7a/libmupdfcore.a(load-tiff.o): in function fz_load_tiff:jni/../../../source/fitz/load-tiff.c:804: error: undefined reference to 'fz_unpack_tile'
C:/Android-NDK/android-ndk/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-v7a/libmupdfcore.a(load-png.o): in function fz_load_png:jni/../../../source/fitz/load-png.c:567: error: undefined reference to 'fz_unpack_tile'
On analyzing the first error, I understood that fz_unpack_tile, fz_decode_tile, fz_decode_indexed_tile are defined in fitz/draw-unpack.c
Now, I am not sure of how to continue from here
You asked this on irc yesterday, and I suggested that you do a complete clean, then rebuild from scratch capturing the logs and post them somewhere.
The code as supplied in git builds just fine in android for us. Without more information, no one is going to be able to help you.
I am creating an android application which is having native C code along with sqlite database.
When I do a ndk-build from my jni folder,I am getting the following error.
undefined reference to `sqlite3_open'
peard.c:(.text+0x588): undefined reference to `sqlite3_exec'
peard.c:(.text+0x5f8): undefined reference to `sqlite3_exec'
peard.c:(.text+0x668): undefined reference to `sqlite3_exec'
peard.c:(.text+0x6d8): undefined reference to `sqlite3_prepare_v2'
peard.c:(.text+0x720): undefined reference to `sqlite3_column_count'
peard.c:(.text+0x734): undefined reference to `sqlite3_step'
peard.c:(.text+0x774): undefined reference to `sqlite3_column_text'
peard.c:(.text+0x78c): undefined reference to `sqlite3_column_name'
peard.c:(.text+0x800): undefined reference to `sqlite3_close'
I tried to run along with -lsqlite3 command also,but doesn't work.
Thanks.
I solved the problem by adding sqlite3.c source file to my dependency files list in my Android.mk file.Special thanks to hirschhomsalz.
Narain.
You need to build or install sqlite3 (and all other non standard libraries you project depends on) for android, and the build your project with the -L and -I parameters pointing to the arm version of you sqlite libraries and headers.
I am trying to compile my c++ files using cygwin.
\Files are compiled but linking time errors occur
These kind of errors...
undefined reference to `std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::size() const'
and some more errors like
undefined reference to `sqlite3_mprintf'
undefined reference to `sqlite3_exec'
undefined reference to `sqlite3_free'
undefined reference to `sqlite3_free'
undefined reference to `sqlite3_free'
undefined reference to `sqlite3_exec'
please help me out?
Thank you.
It looks like the standard C++ library is not getting linked in. Are you linking your code with g++, gcc or ld? If using the first, that library gets linked in automatically, but not if you're using the other two.
For the errors about sqlite3, you need to add -lsqlite3 to the link command (assuming you have it installed, of course).