【发布时间】:2014-05-29 21:18:15
【问题描述】:
我已包含:
#include "stdio.h"
#include <readline/readline.h>
#include <readline/history.h>
我的编译器包含标志
-lreadline
但我仍然收到错误消息:
fatal error: 'readline/readline.h' file not found
我正在尝试使用函数 readline();
这里有更详细的定义:http://linux.die.net/man/3/readline
【问题讨论】:
-
您使用的是什么操作系统/版本?
-
编译器查找包含文件的路径是什么? (通常,它包括
/usr/include)。readline/readline.h是否存在于该路径中? (例如,/usr/include/readline/readline.h)。如果没有,请通过-I添加正确的路径。 (例如,如果您在 /usr/local 中安装了 readline,请将-I/usr/local/include添加到编译器调用中。) -
@TimCastelijns 2013 x86_64 x86_64 x86_64 GNU/Linux
-
@WilliamPursell 我不能包含任何与平台无关的本地文件,因为它必须在其他系统上使用,我无法控制安装的内容。
-
实际上,我认为你可能是对的@WilliamPursell,谢谢
标签: c linux libreadline