centos7下安装flex,bison

1,修改镜像源为国内镜像源,比如阿里云

(1)首先备份系统自带yum源配置文件/etc/yum.repos.d/CentOS-Base.repo

[root@fengyi flex]# cp /etc/yum.repos.d/CentOS-Base.repo /home/fengyi/Destop

(2)进入yum源配置文件所在的文件夹

[root@fengyi flex]# cd /etc/yum.repos.d/

(3)下载阿里云源文件作为新的yum源配置文件

[root@fengyi yum.repos.d]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

2,安装flex,bison

[root@fengyi flex]# yum install flex bison

3,问题:

(1)flex安装后可以使用,但是链接flex库时,-lfl找不到flex库

[root@fengyi flex]# gcc lex.yy.c -o analyze -lfl
/usr/bin/ld: cannot find -lfl
collect2: error: ld returned 1 exit status

问题分析:
flex包是包含了动态库,不包含动态库的头文件,基于flex的应用程序为基础开发,flex可以正常使用;但是,如果使用flex库里面的源代码,则会导致找不到flex库的问题;

解决方案:
flex-devel包包含了这个包程序开发所有必须的文件,比如头文件、动态库等,安装flex-devel包可以调用flex库代码开发;
安装flex-devel

[root@fengyi flex]# yum install flex-devel

4,package和package-devel的区别

(1)普通package
通常只包含能让程序运行的动态库和配置文件,可以基于package的应用程序开发,不能基于源码开发;
(2)package-devel
带devel后缀的package,则包含使用这个package开发程序的所有的必需文件。比如头文件,等等。有时devel package还包含静态库。

// package-devel包说明介绍链接
https://stackoverflow.com/questions/2358801/what-are-devel-packages

以下package-devel包回答,摘自上述网址:

The *-devel packages (usually called *-dev in Debian-based distributions) are usually all the files necessary to compile code against a given library.For running an application using the library libfoo only the actualy shared library file (*.so.*, for example libfoo.so.1.0) are needed (plus possibly some data files and some version-specific symlinks).When you actually want to compile a C application that uses that library you'll need the header files (*.h, for example foo.h) that describe the interface of that application as well as a version-less symlink to the shared library (*.so, for example libfoo.so -> libfoo.so.1.0). Those are usually bundled in the *-devel packages.Sometimes the *-devel packages also include statically compiled versions of the libraries (*.a, for example libfoo.a) in case you want to build a complete stand-alone application that doesn't depend on dynamic libraries at all.Other languages (such as Java, Python, ...) use a different way of noting the API of a library (effectively including all the necessary information in the actual library) and thus usually need no separate *-devel packages (except maybe for documentation and additional tools).

centos7下安装flex,bison相关推荐

  1. Centos7下安装Docker

    Centos7下安装Docker(详细的新手装逼教程) 参考: https://www.cnblogs.com/qgc1995/archive/2018/08/29/9553572.html 早就听说 ...

  2. linux 安装redis2.8.3,centos7下安装Redis2.8版本步骤

    Redis 简介 Redis支持数据的持久化,可以将内存中的数据保存在磁盘中,重启的时候可以再次加载进行使用. Redis不仅仅支持简单的key-value类型的数据,同时还提供list,set,zs ...

  3. linux Centos7下安装python3及pip3

    linux Centos7下安装python3及pip3 先去python官网下载python3安装包 执行命令: wget https://www.python.org/ftp/python/3.6 ...

  4. 学习笔记(1)centos7 下安装nginx

    学习笔记(1)centos7 下安装nginx 这里我是通过来自nginx.org的nginx软件包进行安装的. 1.首先为centos设置添加nginx的yum存储库 1.通过vi命令创建一个rep ...

  5. centos7下安装mariadb

    centos7下安装mariadb 参考: http://www.cnblogs.com/Netsharp/p/5875474.html https://downloads.mariadb.org/m ...

  6. CentOS7下安装nginx1.99

    文章目录 1.前期准备 1.1 安装gcc 1.2 安装其他依赖包 1.3 下载安装包 2.安装nginx 2.1 解压nginx 2.2 编译安装 2.3 启动 2.4 常用命令 3.Nginx配置 ...

  7. CentOS7下安装GUI图形界面

    1.如何在centOS7下安装GUI图形界面 当你安装centOS7服务器版本的时候,系统默认是不会安装GUI的图形界面程序,这个需要手动安装CentOS7 Gnome GUI包. 2.在系统下使用命 ...

  8. 在CentOS7下安装MySQL8数据库

    在CentOS7下安装MySQL8数据库 一 准备Linux环境 默认已安装:Linux虚拟机+ CentOS 笔者用的是如下版本: VMware15:VMware-workstation-full- ...

  9. Redis基础2(Centos7 下 安装redis)

    Centos7 下 安装redis redis是一个软件,帮助开发者对一台机器的内存进行操作. 1.安装redis 第一步:下载redis安装包 命令 :wget http://download.re ...

最新文章

  1. ui设计师要懂哪些B端设计原则?
  2. 【PAT乙级】1059 C语言竞赛 (20 分)
  3. 接口管理平台DOClever5.2.0 发布,大幅增强自动化测试,支持可视化UI
  4. Jenkins命令可视化
  5. [Leetcode][第112题][JAVA][路径总和][递归][队列]
  6. 《树莓派Python编程入门与实战》——2.1 了解Linux
  7. php7 imagick扩展,php7如何安装imagick扩展
  8. Fusion 360软件安装
  9. Dell 电脑插入耳机无声音或重启后有声音
  10. 解除百度云下载限制速度(谷歌浏览器)
  11. NOIP训练 czy的后宫5(树形dp)
  12. poj 2456 Aggressive cows 【二分+最大化最小值】
  13. Cython 入门教程
  14. Linux 系统进程、线程之间的爱恨纠葛
  15. php输出源代码,PHP源代码分析-echo实现详解
  16. 黑客术语基础知识快速了解
  17. blogbus.com(博客大巴)XSS跨站漏洞
  18. 如何从零打造爆款小程序
  19. 蓝桥杯—奇妙的数字(小明发现了一个奇妙的数字)
  20. 基础地图-在线地图-天地图(标注)

热门文章

  1. 长沙理工大学ACMore编程协会2018年新生赛(重现赛)
  2. Java框架jboot_微服务框架 Jboot 2.0.5 发布,常规更新
  3. 一个 将一个无效参数传递给了将无效参数视为严重错误的函数 及写入位置时发生访问冲突的问题的解决
  4. [Winows 软件推荐] 四款常用精品的软件
  5. mysql for mac 重置密码_Mac版,mysql重置密码
  6. ego-motion 自我运动
  7. 链家租房市场分析(R爬虫、数据可视化)
  8. 微信小程序开发笔记1——使用npm脚本实现自动化切换环境配置
  9. 庆祝livid公布Bible的源代码,鼓掌~~
  10. sencha list