简体   繁体   English

使用Android-NDK的NCurses 6.0编译错误

[英]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. 我正在尝试使用android-ndk交叉编译ncurses,但是编译错误显示了过程的一半。

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. 发生此错误的通常原因是,您针对android-23或更高版本进行了编译,但针对较早版本进行了链接。 Another variation of that issue is when you have multiple libraries built against different API levels. 该问题的另一个变体是当您针对不同的API级别构建了多个库时。

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. 如果是正确的话,那么我可能会怀疑您的问题是libcurses的一部分(FWIR根本没有这样的东西,所以不太可能)的预建库,或者它们的构建脚本中发生了一些时髦的事情,从而导致了两者之一我提到的问题。 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. 大量的项目在其构建脚本中添加了自己的Android特有的技巧,这些技巧最终总是导致此类问题的发生,因此这完全不会令我感到惊讶。

Should look at both the compilation command for tic.c and the link command for whatever library/executable is failing to link there. 应该同时查看tic.c的编译命令和任何链接失败的库/可执行文件的链接命令。 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 ). 确保两者都使用相同的API级别(查找类似$NDK/platforms/android-$API_LEVEL -D__ANDROID_API__=$API_LEVEL-D__ANDROID_API__=$API_LEVEL-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 . 顺便说一句,不是ncurses 6,但我有一个示例显示了如何使用必须构建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. 可能值得一看,看看是否有帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM