找不到'readline/readline.h'文件 [英] 'readline/readline.h' file not found

查看:418
本文介绍了找不到'readline/readline.h'文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我包括了:

#include "stdio.h"    
#include <readline/readline.h>
#include <readline/history.h>

并且我的编译器包含标志

and my compiler includes the flag

-lreadline

但是我仍然收到错误消息:

but I am still receiving the error message:

fatal error: 'readline/readline.h' file not found

我正在尝试使用readline()函数;

I am trying to use the function, readline();

在此处详细定义: http://linux.die.net/man/3/readline

推荐答案

您引用了Linux发行版,因此需要安装readline开发库

You reference a Linux distribution, so you need to install the readline development libraries

在基于Debian的平台(例如Ubuntu)上,您可以运行:

On Debian based platforms, like Ubuntu, you can run:

sudo apt-get install libreadline-dev 

并且应该在正确的位置安装正确的标头.

and that should install the correct headers in the correct places,.

如果您使用带有yum的平台(如SUSE),则命令应为:

If you use a platform with yum, like SUSE, then the command should be:

yum install readline-devel

这篇关于找不到'readline/readline.h'文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆