225 Star 1.1K Fork 342

GVPzlgopen / awtk

 / 详情

ubuntu 20.04 awtk 编译错误

待办的
创建于  
2022-01-27 09:27

最近有时间准备看下贵项目的代码,发现pull最新的master代码后, 报如下错误
tests/fdb.cpp:28:10: fatal error: readline/history.h: No such file or directory
28 | #include <readline/history.h>
| ^~~~~~~~~~~~~~~~~~~~
由于还不熟悉代码结构, 问下大家的修改意见,谢谢。

以前编译过,没问题.

评论 (3)

hocker 创建了任务

对代码进行定位, 发现确实没得该文件, 该文件在
./tests/fdb.cpp
./src/hal/tools/network_shell/network_shell.c
中引用, 主要不知道该文件的作用和内容,我调式下。

在fdb.cpp 中删除readline的头文件引用后, 报如下错误:

tests/fdb.cpp: In function 'char** command_completion(const char*, int, int)':
tests/fdb.cpp:36:15: error: 'rl_completion_matches' was not declared in this scope
   36 |     matches = rl_completion_matches(text, command_generator);
      |               ^~~~~~~~~~~~~~~~~~~~~
tests/fdb.cpp: In function 'ret_t aw_read_line_init()':
tests/fdb.cpp:42:3: error: 'rl_readline_name' was not declared in this scope
   42 |   rl_readline_name = (char*)"fdb";
      |   ^~~~~~~~~~~~~~~~
tests/fdb.cpp:43:3: error: 'rl_attempted_completion_function' was not declared in this scope
   43 |   rl_attempted_completion_function = command_completion;
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tests/fdb.cpp: In function 'char* aw_read_line(const char*)':
tests/fdb.cpp:49:10: error: 'readline' was not declared in this scope; did you mean 'readlink'?
   49 |   return readline(tips);
      |          ^~~~~~~~
      |          readlink
tests/fdb.cpp: In function 'ret_t aw_read_line_add_history(char*)':
tests/fdb.cpp:58:3: error: 'add_history' was not declared in this scope
   58 |   add_history(line);
      |   ^~~~~~~~~~~
tests/fdb.cpp: In function 'ret_t code_get_line(const char*, uint32_t, int32_t, str_t*)':
tests/fdb.cpp:114:14: warning: comparison of integer expressions of different signedness: 'int32_t' {aka 'int'} and 'uint32_t' {aka 'unsigned int'} [-Wsign-compare]
  114 |   if (offset >= size) {
      |       ~~~~~~~^~~~~~~
tests/fdb.cpp:118:17: warning: comparison of integer expressions of different signedness: 'int32_t' {aka 'int'} and 'uint32_t' {aka 'unsigned int'} [-Wsign-compare]
  118 |   for (; offset < size; offset++) {
      |          ~~~~~~~^~~~~~
scons: *** [tests/fdb.o] Error 1
scons: building terminated because of errors.

安装这个包libreadline-dev

登录 后才可以发表评论

状态
负责人
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
参与者(2)
C
1
https://gitee.com/zlgopen/awtk.git
git@gitee.com:zlgopen/awtk.git
zlgopen
awtk
awtk

搜索帮助