代码拉取完成,页面将自动刷新
最近有时间准备看下贵项目的代码,发现pull最新的master代码后, 报如下错误
tests/fdb.cpp:28:10: fatal error: readline/history.h: No such file or directory
28 | #include <readline/history.h>
| ^~~~~~~~~~~~~~~~~~~~
由于还不熟悉代码结构, 问下大家的修改意见,谢谢。
以前编译过,没问题.
对代码进行定位, 发现确实没得该文件, 该文件在
./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
登录 后才可以发表评论