Iotivity scons build error(cbor) - android

This is my build environment
Ubuntu 14.04 LTS
Android NDK r10d
Android SDK API 21 SDK Platporm, build-tools 20
but, when I build scons TARGET_OS=android TARGET_ARCH=armeabi
they throw exception on building like
Archiving out/android/armeabi/release/resource/csdk/security/libocsrm.a
Indexing Archive out/android/armeabi/release/resource/csdk/security/libocsrm.a
Install file: "out/android/armeabi/release/resource/csdk/security/libocsrm.a" as "out/android/armeabi/release/libocsrm.a"
Linking out/android/armeabi/release/resource/csdk/liboctbstack.so
out/android/armeabi/release/resource/csdk/stack/src/ocpayloadparse.os:ocpayloadparse.c:function OCParseStringLL: error: undefined reference to '_cbor_value_dup_string'
out/android/armeabi/release/resource/csdk/stack/src/ocpayloadparse.os:ocpayloadparse.c:function OCParseSingleRepPayload: error: undefined reference to '_cbor_value_dup_string'
out/android/armeabi/release/resource/csdk/stack/src/ocpayloadparse.os:ocpayloadparse.c:function OCParseSingleRepPayload: error: undefined reference to '_cbor_value_dup_string'
out/android/armeabi/release/resource/csdk/stack/src/ocpayloadparse.os:ocpayloadparse.c:function OCParseSingleRepPayload: error: undefined reference to '_cbor_value_dup_string'
collect2: error: ld returned 1 exit status
scons: *** [out/android/armeabi/release/resource/csdk/liboctbstack.so] Error 1
scons: building terminated because of errors.
I don't know what to do, How can I resolve it?

Add one line in file tinycbor/SConscript
cbor_src = [
...
os.path.join(cborDir, 'src/cborparser_dup_string.c'), <- add this line

Related

undefined reference to 'log','exp','log10' opencv4.5.4

Iam build OpenCV 4.5.4 from source for Android and ABI x64_86, with NDK r21e.
Build was success without errors.
Then I create a Shared Object project in Visual Studio 2022,
where are a simple function to summ 2 Mat objects.
In project properies(Release x64) I put refs to include folder "...native\jni\include",
and link static(*.a) compiled libs "native\staticlibs\x86_64", "native\3rdparty\libs\x86_64"
Linked libs:
opencv_core
ippiw
ittnotify
ippicv
zlib
When I trying to build(Release x64), I have some link errors:
1> undefined reference to 'log'
1> undefined reference to 'log10'
1> undefined reference to 'exp'
1> undefined reference to 'log'
1> undefined reference to 'exp'
1> undefined reference to 'exp'
1> undefined reference to 'logf'
1> undefined reference to 'logf'
1>clang: error: linker command failed with exit code 1 (use -v to see invocation)
Thanks.
Found solution with -lm flag at
Linker/Additional Options.
And for me is still a riddle what that flag(-lm) means?

NCurses 6.0 Compilation Error Using Android-NDK

I'm trying to cross-compile ncurses using android-ndk but compilation error shows halfway the process.
Command:
CC=~/my-toolchain/bin/arm-linux-androideabi-gcc ./configure --host=arm-linux-androideabi --prefix=/Android
Output:
** Configuration summary for NCURSES 6.0 20150808:
extended funcs: yes
xterm terminfo: xterm-new
bin directory: /Android/bin
lib directory: /Android/lib
include directory: /Android/include/ncurses
man directory: /Android/share/man
terminfo directory: /Android/share/terminfo
** Include-directory is not in a standard location
Command
make
Output
../objects/tic.o:tic.c:function usage: error: undefined reference to 'stderr'
../objects/tic.o:tic.c:function put_translate: error: undefined reference to 'stdout'
../objects/tic.o:tic.c:function copy_input: error: undefined reference to 'stderr'
../objects/tic.o:tic.c:function open_input: error: undefined reference to 'stdin'
../objects/tic.o:tic.c:function open_input: error: undefined reference to 'stderr'
../objects/tic.o:tic.c:function show_databases: error: undefined reference to 'stdout'
../objects/tic.o:tic.c:function show_databases: error: undefined reference to 'stderr'
../objects/dump_entry.o:dump_entry.c:function show_entry: error: undefined reference to 'stdout'
../objects/dump_entry.o:dump_entry.c:function compare_entry: error: undefined reference to 'stdout'
../lib/libncurses.a(lib_twait.o):lib_twait.c:function _nc_timed_wait: error: undefined reference to '__FD_SET_chk'
../lib/libncurses.a(lib_twait.o):lib_twait.c:function _nc_timed_wait: error: undefined reference to '__FD_SET_chk'
../lib/libncurses.a(lib_twait.o):lib_twait.c:function _nc_timed_wait: error: undefined reference to '__FD_ISSET_chk'
../lib/libncurses.a(lib_twait.o):lib_twait.c:function _nc_timed_wait: error: undefined reference to '__FD_ISSET_chk'
collect2: error: ld returned 1 exit status
Makefile:242: recipe for target 'tic' failed
make[1]: *** [tic] Error 1
make[1]: Leaving directory '/home/jrm/softether/src/curses/ncurses-6.0/progs'
Makefile:113: recipe for target 'all' failed
make: *** [all] Error 2
I don't have any idea about the error. I tried using google but i can't seem to find similar problems like mine.
The usual reason for this error is that you've compiled against android-23 or higher but are linking against something earlier. Another variation of that issue is when you have multiple libraries built against different API levels.
It looks like you are using a standalone toolchain? If that's correct, then I'd suspect your issue is either a prebuilt library that's part of libcurses (FWIR there aren't any of those, so unlikely) or that there's something funky going on in their build scripts that causes one of the two issues I mentioned. Tons of projects add their own Android specific hacks to their build scripts that always end up being the cause of these sorts of issues, so that wouldn't surprise me at all.
Should look at both the compilation command for tic.c and the link command for whatever library/executable is failing to link there. Make sure both are using the same API levels (look for things like $NDK/platforms/android-$API_LEVEL, -D__ANDROID_API__=$API_LEVEL, and -target arm-linux-androideabi$API_LEVEL).
btw, not ncurses 6, but I do have an example showing how to use standalone toolchains that had to build ncurses 5.9: https://github.com/DanAlbert/lua-ndk/blob/master/build_lua_with_libreadline.sh#L75. Might be worth taking a look to see if that helps at all.

Cricket audio engine CMAKE

Did anyone implemeted Cricket audio engine (http://www.crickettechnology.com/blog/) for Android Studio using gradle and Cmake (Android NDK) ?
I have imported the lib in my Cmake like this:
target_link_libraries(test
${CMAKE_CURRENT_SOURCE_DIR}/../../test/cricketaudio/lib/libck.a)
And the compiler sees it alright but when I try to run it, the linker gives me this error:
Error while executing process
[1/1] Linking CXX shared library
..\..\..\..\build\intermediates\cmake\development\debug\obj\armeabi-
v7a\libtest.so
FAILED: cmd.exe -soname,libtest.so -o
..\..\..\..\build\intermediates\cmake\development\debug\obj\armeabi-
v7a\libtest.so #CMakeFiles/test.rsp && cd ."
core/system_android.cpp:174: error: undefined reference to
'android_getCpuFamily'
core/system_android.cpp:187: error: undefined reference to
'android_getCpuFeatures'
core/system_android.cpp:210: error: undefined reference to
'android_getCpuCount'
clang++.exe: error: linker command failed with exit code 1 (use -v to see
invocation)
ninja: build stopped: subcommand failed.
I am aware that libck (cricket audio) has a dependency lib the Android NDK cpufeauters lib which is located in the Android NDK bundle (Android\Sdk\ndk-bundle\sources\android\cpufeatures).
I don`t know how to make this cpufeatures lib visible to the Linker of my project ???
Any help or pointers would be appreciated.
I have simply included the cpu-features.c and header file to my cmakelist and now it works :).

GStreamer "undefined reference to '__srget'"

I have troubles to run the GStreamer tutorials. I followed all tutorial steps, and run into an error.
My System:
android-ndk-r11c, gstreamer-sdk-android-arm-debug-2013.6
My System: Windows 10 - 64 bit
The Error:
C:\gstreamer-sdk-android-arm-debug-2013.6\share\gst-sdk\tutorials\android-tutorial-1>ndk-build
GStreamer : [GEN] => gst-build/gstreamer_android.c
GStreamer : [COMPILE] => gst-build/gstreamer_android.c
GStreamer : [LINK] => gst-build/libgstreamer_android.so
lex.priv_gst_parse_yy.c:1598: error: undefined reference to '__srget'
gutils.c:2406: error: undefined reference to 'issetugid'
localcharset.c:158: error: undefined reference to '__srget'
localcharset.c:167: error: undefined reference to '__srget'
./localcharset.c:195: error: undefined reference to '__srget'
/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.exe: error: ld returned 1 exit status
make: *** [buildsharedlibrary] Error 1
C:\gstreamer-sdk-android-arm-debug-2013.6\share\gst-sdk\tutorials\android-tutorial-1>
I tried:
Windows linkage problems : Due to problems related to the standard linker, Google’s Gold Linker is used to build GStreamer applications. Unfortunately, the Android NDK toolchain for Windows does not include the gold linker and the standard one has to be used.
If you observe linkage problems, you can replace the linker in your Android NDK with the gold one from this project. Download the android-ndk-r8b-ma-windows.7z file, extract \android-ndk-r8b\toolchains\arm-linux-androideabi-4.6\prebuilt\windows\arm-linux-androideabi\bin\ld.exe (only this file is needed) and overwrite the one in the same folder in your Android NDK installation.
No effect. Any ideas how to solve this?
I had similar problem before please give a try with ndk10b.It is always good to check in header files for __srget before move forward.

CMU-Sphinx android build error

I recently using CMU-Sphinx for Android. When I try to build the sample project from the websites, I got the following error:
"Compile thumb : pocketsphinx_jni <= pocketsphinx_wrap.c
C:/CMUSphhinx/PocketSphinxAndroidDemo//jni/pocketsphinx_wrap.c: In function 'nbest_s_hyp':
C:/CMUSphhinx/PocketSphinxAndroidDemo//jni/pocketsphinx_wrap.c:793:6: warning: return makes pointer from integer without a cast [enabled by default]
C:/CMUSphhinx/PocketSphinxAndroidDemo//jni/pocketsphinx_wrap.c: In function 'ps_decoder_s_getHyp':
C:/CMUSphhinx/PocketSphinxAndroidDemo//jni/pocketsphinx_wrap.c:847:3: warning: return makes pointer from integer without a cast [enabled by default]
SharedLibrary : libpocketsphinx_jni.so
C:/CMUSphhinx/PocketSphinxAndroidDemo//obj/local/armeabi/objs/pocketsphinx_jni/pocketsphinx_wrap.o: In function nbest_s_hyp':
C:/CMUSphhinx/PocketSphinxAndroidDemo//jni/pocketsphinx_wrap.c:793: undefined reference tonew_Hypothesis'
C:/CMUSphhinx/PocketSphinxAndroidDemo//obj/local/armeabi/objs/pocketsphinx_jni/pocketsphinx_wrap.o: In function ps_decoder_s_getHyp':
C:/CMUSphhinx/PocketSphinxAndroidDemo//jni/pocketsphinx_wrap.c:847: undefined reference tonew_Hypothesis'
collect2: ld returned 1 exit status
make: * [C:/CMUSphhinx/PocketSphinxAndroidDemo//obj/local/armeabi/libpocketsphinx_jni.so] Error 1
I am using Windows with these tools:
eclipse Indigo.
android 2.2 sdk
android ndkbuild-r8b
swigwin-2.0.8
and this is my configuration on my eclipse:
SWIG:
Main: C:\swigwin-2.0.8\swig.exe
NDK-build:
Main:
C:\android-ndk-r8b\ndk-build.cmd
Try swig 1.3. There could be issues with 2.0. Check full build log for details.
pocketsphinx-0.7 is incompatible with the swig-2.0.8

Categories

Resources