I am trying the static compilation with Python3.6.2 and cross-compiling for android. And nmake threw following exceptions when running:
Python\formatter_unicode.c: In function 'get_locale_info':
Python\formatter_unicode.c:711:53: error: 'struct lconv' has no member named 'decimal_point'
locale_data->decimal_point,
^
Python\formatter_unicode.c:716:53: error: 'struct lconv' has no member named 'thousands_sep'
locale_data->thousands_sep,
^
Python\formatter_unicode.c:720:44: error: 'struct lconv' has no member named 'grouping'
locale_info->grouping = locale_data->grouping;
^
Makefile:14273: recipe for target '.obj\formatter_unicode.obj' failed
nmake: *** [.obj\formatter_unicode.obj] Error 1
I've googled a lot but almost nothing practical was found so far. I didn't understand what happened at all although I saw the source code(I just knew a little about C/C++).
Could anyone give some of suggestions to me?
Thank you in advance.
Related
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.
i am new in android ndk and i m making connection of java and c/c++ code and at last moment when i use ndk-build command then i got this error.
please help me to clear this problem.
I am working on ubuntu 12.04. and i got same error on both linux and windows and on windows i use using cygwin.
Error-
/home/saicomputer/android-ndk-r8e/build/core/add-application.mk:128: Android NDK: WARNING: APP_PLATFORM android-14 is larger than android:minSdkVersion 8 in ./AndroidManifest.xml
Compile thumb : myjni <= native.c
jni/native.c: In function 'Java_com_example_demo_MainActivity_hello':
jni/native.c:4:3: error: parameter name omitted
jni/native.c:4:3: error: parameter name omitted
jni/native.c:5:10: error: 'env' undeclared (first use in this function)
jni/native.c:5:10: note: each undeclared identifier is reported only once for each function it appears in
jni/native.c: In function 'Java_com_example_demo_MainActivity_add':
jni/native.c:9:3: error: parameter name omitted
jni/native.c:9:3: error: parameter name omitted
jni/native.c:9:3: error: parameter name omitted
jni/native.c:9:3: error: parameter name omitted
jni/native.c:10:9: error: 'value1' undeclared (first use in this function)
jni/native.c:10:18: error: 'value2' undeclared (first use in this function)
make: *** [obj/local/armeabi/objs/myjni/native.o] Error 1
please help me out to overcome this problem.
thanks.
I am using https://github.com/lilac/Android-ImageMagick to build an ImageMagick library for Android. When trying to ndk-build ImageMagick I end up with the below errors.
primary0:AndroidMagickActivity primary0$ ~/ndk/ndk-build
SharedLibrary : libandroid-magick.so
/Users/primary0/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/darwin-x86/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: ./obj/local/armeabi/libcoders.a(jpeg.o): in function ReadJPEGImage:jni/../ndk-modules/ImageMagick-6.7.3-0/coders/jpeg.c:988: error: undefined reference to 'jpeg_std_error'
/Users/primary0/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/darwin-x86/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: ./obj/local/armeabi/libcoders.a(jpeg.o): in function ReadJPEGImage:jni/../ndk-modules/ImageMagick-6.7.3-0/coders/jpeg.c:995: error: undefined reference to 'jpeg_destroy_decompress'
/Users/primary0/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/darwin-x86/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: ./obj/local/armeabi/libcoders.a(jpeg.o): in function ReadJPEGImage:jni/../ndk-modules/ImageMagick-6.7.3-0/coders/jpeg.c:1004: error: undefined reference to 'jpeg_CreateDecompress'
/Users/primary0/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/darwin-x86/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: ./obj/local/armeabi/libcoders.a(jpeg.o): in function ReadJPEGImage:jni/../ndk-modules/ImageMagick-6.7.3-0/coders/jpeg.c:1006: error: undefined reference to 'jpeg_set_marker_processor'
/Users/primary0/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/darwin-x86/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: ./obj/local/armeabi/libcoders.a(jpeg.o): in function ReadJPEGImage:jni/../ndk-modules/ImageMagick-6.7.3-0/coders/jpeg.c:1007: error: undefined reference to 'jpeg_set_marker_processor'
/Users/primary0/ndk/toolchains/arm-linux-androideabi-4.6/prebuilt/darwin-x86/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: ./obj/local/armeabi/libcoders.a(jpeg.o): in function ReadJPEGImage:jni/../ndk-modules/ImageMagick-6.7.3-0/coders/jpeg.c:1008: error: undefined reference to 'jpeg_set_marker_
.
.
.
collect2: ld returned 1 exit status
make: *** [obj/local/armeabi/libandroid-magick.so] Error 1
primary0:AndroidMagickActivity primary0$
The header file that defines the constants listed in the error is included jpeg.c
#include "jpeglib.h"
Any of you guys have an idea why I'm getting the undefined reference error?
The linker is not looking for "constants" it's looking for jump addresses to call functions. Your code obviously uses functions which are not available in the object code. This can have various reasons. Either you did not tell the compiler to use a library which is availabe or (in your case more likely) you did not tell the compiler that jpeg.c also needs to be compiled for this shared object. But this is difficult to diagnose without seeing the makefile.
Taking a short look at the ndk-modules folder of the git repository I get the feeling you need to build multiple modules. Maybe you just do it in the wrong order. Try building jpeg first.
I am getting these errors when i am trying to compile my sample native (cpp) code in my machine. I am trying to compile the native code with the help of the NDK from the cygwin.
I am getting the below errors, i tried adding the LDFLAGS but still getting the same error
LOCAL_LDLIBS := -llog
sh-4.1$ /cygdrive/c/Android/android-ndk-r6/ndk-build
Compile++ thumb : JNIExampleInterface <= JNIExampleInterface.cpp
D:/EclipseWorkspace/NativeExample/jni/JNIExampleInterface.cpp:5:44: error: android_runtime/AndroidRuntime.h: No such file or directory
D:/EclipseWorkspace/NativeExample/jni/JNIExampleInterface.cpp: In function 'void callback_handler(char*)':
D:/EclipseWorkspace/NativeExample/jni/JNIExampleInterface.cpp:36: error: 'LOGE' was not declared in this scope
D:/EclipseWorkspace/NativeExample/jni/JNIExampleInterface.cpp:51: error: 'LOGE' was not declared in this scope
D:/EclipseWorkspace/NativeExample/jni/JNIExampleInterface.cpp:59: error: 'LOGE' was not declared in this scope
D:/EclipseWorkspace/NativeExample/jni/JNIExampleInterface.cpp: In function 'void Java_com_nativeexample_JNIExampleInteace_callVoid(JNIEnv*, _jclass*)':
D:/EclipseWorkspace/NativeExample/jni/JNIExampleInterface.cpp:88: error: 'LOGE' was not declared in this scope
D:/EclipseWorkspace/NativeExample/jni/JNIExampleInterface.cpp: In function '_jobject* Java_com_nativeexample_JNIExamplnterface_getNewData(JNIEnv*, _jclass*, jint, _jstring*)':
D:/EclipseWorkspace/NativeExample/jni/JNIExampleInterface.cpp:103: error: 'LOGE' was not declared in this scope
D:/EclipseWorkspace/NativeExample/jni/JNIExampleInterface.cpp:110: error: 'LOGE' was not declared in this scope
D:/EclipseWorkspace/NativeExample/jni/JNIExampleInterface.cpp:117: error: 'LOGE' was not declared in this scope
D:/EclipseWorkspace/NativeExample/jni/JNIExampleInterface.cpp: In function '_jstring* Java_com_nativeexample_JNIExamplnterface_getStringInData(JNIEnv*, _jclass*, _jobject*)':
D:/EclipseWorkspace/NativeExample/jni/JNIExampleInterface.cpp:135: error: 'LOGE' was not declared in this scope
D:/EclipseWorkspace/NativeExample/jni/JNIExampleInterface.cpp:142: error: 'LOGE' was not declared in this scope
D:/EclipseWorkspace/NativeExample/jni/JNIExampleInterface.cpp: In function 'void initClassHelper(JNIEnv*, const char*,jobject**)':
D:/EclipseWorkspace/NativeExample/jni/JNIExampleInterface.cpp:163: error: 'LOGE' was not declared in this scope
D:/EclipseWorkspace/NativeExample/jni/JNIExampleInterface.cpp:170: error: 'LOGE' was not declared in this scope
D:/EclipseWorkspace/NativeExample/jni/JNIExampleInterface.cpp:177: error: 'LOGE' was not declared in this scope
D:/EclipseWorkspace/NativeExample/jni/JNIExampleInterface.cpp: In function 'jint JNI_OnLoad(JavaVM*, void*)':
D:/EclipseWorkspace/NativeExample/jni/JNIExampleInterface.cpp:193: error: 'LOGI' was not declared in this scope
D:/EclipseWorkspace/NativeExample/jni/JNIExampleInterface.cpp:195: error: 'LOGE' was not declared in this scope
D:/EclipseWorkspace/NativeExample/jni/JNIExampleInterface.cpp:221: error: 'android' has not been declared
D:/EclipseWorkspace/NativeExample/jni/JNIExampleInterface.cpp:222: error: 'NELEM' was not declared in this scope
D:/EclipseWorkspace/NativeExample/jni/JNIExampleInterface.cpp:223: error: 'LOGE' was not declared in this scope
make: *** [/cygdrive/d/EclipseWorkspace/NativeExample/obj/local/armeabi/objs/JNIExampleInterface/JNIExampleInterface.o
Error 1
sh-4.1$
I am following the example in the net
http://android.wooyd.org/JNIExample/
If i am anything wrong please correct me. If my question is not perfect or not understandable, please leave a comment and give me a chance to correct the same.
Thanks & Regards,
SSuman185
I am able to resolve only the LOGE error by using the below declarations:
#define LOG_TAG "libJNIExInterface"
#define LOGI(...) __android_log_print(ANDROID_LOG_INFO,LOG_TAG,__VA_ARGS__)
#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR,LOG_TAG,__VA_ARGS__)
Double under score is present before the "android_log.....".
The other error which is "NELEM" doing the registration of the native functions at the android runtime is not required, but can be done only if you have whole android source code, when you are compiling this application along with the android source code, otherwise it is not possible).
So, Android runtime registration is not possible when you do not have the full android source code, anyway my app is working fine with out this as well.
In case someone have still this problem:
The logging macros have been renamed, and it's ALOGE now.
I am trying to compile Android (Froyo) from the source for my Nexus One. I pretty much followed all instructions from here.
Though the instructions are for Gingerbread, I don't really see much of a difference for Froyo. After I do a "make -j4", the following error is thrown:
Install: out/target/product/passion/system/lib/libmedia.so
target SharedLib: libstagefright_foundation (out/target/product/passion/obj/SHARED_LIBRARIES/libstagefright_foundation_intermediates/LINKED/libstagefright_foundation.so)
target SharedLib: libstagefright_color_conversion (out/target/product/passion/obj/SHARED_LIBRARIES/libstagefright_color_conversion_intermediates/LINKED/libstagefright_color_conversion.so)
target SharedLib: libaudio (out/target/product/passion/obj/SHARED_LIBRARIES/libaudio_intermediates/LINKED/libaudio.so)
target SharedLib: libaudiopolicy (out/target/product/passion/obj/SHARED_LIBRARIES/libaudiopolicy_intermediates/LINKED/libaudiopolicy.so)
target SharedLib: libcameraservice (out/target/product/passion/obj/SHARED_LIBRARIES/libcameraservice_intermediates/LINKED/libcameraservice.so)
prebuilt/darwin-x86/toolchain/arm-eabi-4.4.3/bin/../lib/gcc/arm-eabi/4.4.3/../../../../arm-eabi/bin/ld: out/target/product/passion/obj/SHARED_LIBRARIES/libcameraservice_intermediates/CameraService.o: in function android::CameraService::getCameraInfo(int, android::CameraInfo*):frameworks/base/services/camera/libcameraservice/CameraService.cpp:109: error: undefined reference to 'HAL_getCameraInfo'
prebuilt/darwin-x86/toolchain/arm-eabi-4.4.3/bin/../lib/gcc/arm-eabi/4.4.3/../../../../arm-eabi/bin/ld: out/target/product/passion/obj/SHARED_LIBRARIES/libcameraservice_intermediates/CameraService.o: in function android::CameraService::CameraService():frameworks/base/services/camera/libcameraservice/CameraService.cpp:75: error: undefined reference to 'HAL_getNumberOfCameras'
prebuilt/darwin-x86/toolchain/arm-eabi-4.4.3/bin/../lib/gcc/arm-eabi/4.4.3/../../../../arm-eabi/bin/ld: out/target/product/passion/obj/SHARED_LIBRARIES/libcameraservice_intermediates/CameraService.o: in function android::CameraService::CameraService():frameworks/base/services/camera/libcameraservice/CameraService.cpp:75: error: undefined reference to 'HAL_getNumberOfCameras'
prebuilt/darwin-x86/toolchain/arm-eabi-4.4.3/bin/../lib/gcc/arm-eabi/4.4.3/../../../../arm-eabi/bin/ld: out/target/product/passion/obj/SHARED_LIBRARIES/libcameraservice_intermediates/CameraService.o: in function android::CameraService::connect(android::sp<android::ICameraClient> const&, int):frameworks/base/services/camera/libcameraservice/CameraService.cpp:148: error: undefined reference to 'HAL_openCameraHardware'
prebuilt/darwin-x86/toolchain/arm-eabi-4.4.3/bin/../lib/gcc/arm-eabi/4.4.3/../../../../arm-eabi/bin/ld: out/target/product/passion/obj/SHARED_LIBRARIES/libcameraservice_intermediates/CameraService.o: in function android::CameraService::connect(android::sp<android::ICameraClient> const&, int):frameworks/base/services/camera/libcameraservice/CameraService.cpp:154: error: undefined reference to 'HAL_getCameraInfo'
collect2: ld returned 1 exit status
make: *** [out/target/product/passion/obj/SHARED_LIBRARIES/libcameraservice_intermediates/LINKED/libcameraservice.so] Error 1
make: *** Waiting for unfinished jobs....
Note: cts/tools/dx-tests/src/dxc/junit/opcodes/invokeinterface/jm/T_invokeinterface_1.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
compiling all jasmin (*.j)
compiling all .cfh files into .class files
generating Main_*.java files reading from cts/tools/dx-tests writing to out/host/darwin-x86/obj/EXECUTABLES/dx-tests_intermediates/mainfiles
using java src:cts/tools/dx-tests/src
Collecting all junit tests...
Time: 0.025
OK (0 tests)
Can someone please help me resolve this issue?
The function was named getCameraInfo() in Froyo but was changed to HAL_getCameraInfo() in Gingerbread. Therefore the dynamic library, libcamera.so extracted from a Froyo machine won't work in a Gingerbread build.
I'm not sure if you are able to bypass this…