“打开终端时出错:vt100。”在ARM上使用ncurses运行二进制文件时

时间:2018-11-15 12:57:51

标签: cross-compiling ncurses xterm vt100

我交叉编译了用于ARM的ncurses。编写了一个链接到它的示例应用程序。尝试在ARM上运行二进制文件时,出现此错误。

打开终端错误:vt100。

好像我缺少一些terminfo安装,但并不完全确定该怎么做。有人可以帮我吗?

../ configure命令- ./configure --host arm64-linux-gnu --prefix = / sw / nic / third-party / ncurses-6.1 / arm64 / -with-termlib --enable-termcap --with-caps --disable-database- -with-fallbacks --with-xterm-new

** NCURSES 6.1 20180127的配置摘要:

[
    {
        "Sample1": "Swimm",
        "Sample2": "1:30",
        "Sample3": "2:05",
        "Sample4": "1:15",
        "Sample5": "1:41"
    }
]

**包含目录不在标准位置 在此之后,我将进行包装,将以下内容包装并加载到ARM板上。 ncurses-6.1 / lib / * / usr / share / terminfo / *

谢谢。

关于, 赛

1 个答案:

答案 0 :(得分:1)

ncurses源文件中的INSTALL文件告诉您需要了解的内容:

--disable-database                                                          
    Use only built-in data.  The ncurses libraries normally read terminfo   
    and termcap data from disk.  You can configure ncurses to have a        
    built-in database, aka "fallback" entries.  Embedded applications may   
    have no need for an external database.  Some, but not all of the        
    programs are useful in this configuration, e.g., reset and tput versus  
    infocmp and tic.  

--with-fallbacks=XXX                                                        
    Specify a list of fallback terminal descriptions which will be          
    compiled into the ncurses library.  See CONFIGURING FALLBACK ENTRIES.

问题中显示的命令未列出任何后备终端描述(例如 vt100 )。

该命令应列出要构建到库中的描述,例如

./configure command - ./configure --host arm64-linux-gnu --prefix=/sw/nic/third-party/ncurses-6.1/arm64/ -with-termlib --enable-termcap --with-caps --disable-database --with-fallbacks=vt100 --without-xterm-new

因为您禁用了数据库,所以复制/usr/share/terminfo/*毫无意义,并且由于它使用(默认)静态库,因此无需将libncursesw.a复制到嵌入式系统(在极少数情况下,您实际上使用在arm64机器上运行 的编译器/链接器工具集。

...响应11月18日的跟进:ncurses库中的后备支持仅在调用setupterm(或其调用者newterminitscr的情况下使用) )-参见source code。例如,将运行诸如clear之类的程序,但不会运行infocmp

在快速检查中,我运行了此程序以构建测试副本,并启用ncurses的跟踪功能:

#!/bin/sh
unset TERM
unset TERMINFO
unset TERMINFO_DIRS
./configure \
        --prefix=/tmp/FOO \
        --enable-termcap \
        --with-trace \
        --without-debug \
        --without-ada \
        --with-fallbacks=vt100,vt102,screen
make

,然后在./progs

#!/bin/sh
export TERM=vt100
unset TERMINFO
unset TERMINFO_DIRS
rm -f trace  
export NCURSES_TRACE=0xffff
./clear

(执行unset以避免占用我的环境)。跟踪文件无法确定结果描述的来源。这是在set_curterm调用之前完成的。如果从文件中读取,则会显示出来。但是 clear 命令有效。这是完整的跟踪,显示了对 file -访问的失败调用,最后是带有预期数据的tputs调用:

TRACING NCURSES version 6.1.20181117 (tracelevel=0xffff)
called {setupterm("vt100",0,(nil))
your terminal name is vt100
using 2048 for getstr limit
+ called {_nc_first_db
duplicate /tmp/FOO/share/terminfo
not found /users/tom/.terminfo
not found /tmp/FOO/share/terminfo
not found /etc/termcap
not found /usr/share/misc/termcap
+ return }
+ called {set_curterm(0x242a2a0)
+ return }(nil)
+ called {def_shell_mode((nil)) ->term 0x242a2a0
_nc_get_tty_mode(0): iflags: {BRKINT, IXON} cflags: {CREAD} CS8 lflags: {ISIG}
+ return }0
+ called {def_prog_mode((nil)) ->term 0x242a2a0
_nc_get_tty_mode(0): iflags: {BRKINT, IXON} cflags: {CREAD} CS8 lflags: {ISIG}  
+ return }0
+ called {baudrate((nil))
+ return }38400
screen size: terminfo lines = 24 columns = 80
SYS screen size: environment LINES = 40 COLUMNS = 80
screen size is 40x80
TABSIZE = 8
return }0
tputs( = "\e[H\e[J$<50>", 40, 0x403630) called
called {delay_output(0x7ffca32a2f50,50)
return }0
called {tigetstr((nil), E3)
return }(cancelled)
tputs((cancelled), 40, 0x403630) called

strings上运行clear显示如下:

vt100|vt100-am|dec vt100 (w/advanced video)

这是terminfo源文件的完整行。