本文共 2266 字,大约阅读时间需要 7 分钟。
1.环境:CentOS 7.5.18042.需要安装插件: glib:http://ftp.acc.umu.se/pub/GNOME/sources/glib/ zlib:http://www.zlib.net/ libffi:http://sourceware.org/libffi/ pkg-config:https://www.freedesktop.org/wiki/Software/pkg-config/ pcre:https://sourceforge.net/projects/pcre/files/pcre/3.输出的命令: (1).evince [filename] (2).linux下打开图片文件的命令 eog全称:eye of gmone,是linux下内置的图片查看器。4.安装过程: (1)glib 我下载了个glib-2.56.1.tar.xz,如果是.tar.xz格式先用xz -d 解压为tar文件 然后用tar -xvf解压,如果是.tar.gz格式用tar -zxvf解压 三步:
第一步./configure问题很多 需要安装各种插件 进行第二步
备注:如果第一步报错信息为:
可以使用:--enable-libmount=no 地址:https://github.com/openwrt/packages/issues/3832 (2)zlib
glib报错:
自glib-2.23开始就需要zlib,zlib是提供数据压缩用的函式库。 三步: (3)libffi
zlib报错:
"FFI" 的全名是Foreign Function Interface,通常指的是允许以一种语言编写的代码调用另一种语言的代码。而libffi库只 提供了最底层的、与架构相关的、完整的"FFI",在它之上必须有一层来负责管理两种语言之间参数的格式转换。 三步: (4)pkg-config
libffi报错:
pkg-config能根据软件安装时软件的.pc配置文件路径找到相应的头文件路径和库文件路径。 三步: 如果./configure 报错: 需要:./configure --with-internal-glib (5)pcre glib报错: PCRE(Perl Compatible Regular Expressions)是一个Perl库,包括perl兼容的正则表达式库。这些在执行正规表达式模式匹 配时用与Perl 5同样的语法和语义是很有用的,也可以来解决C语言中使用正则表达式的问题。 ./configure --enable-utf8 --enable-unicode-properties make make install 如果第一步只是./configure,到时候安装glib会继续报错: checking for Unicode support in PCRE... no configure: error: *** The system-supplied PCRE does not support Unicode properties or UTF-8. 所以第一步是为了解决Unicode、UTF-8的支持,仅限于pcre7.9以上版本 *安装pcre如果报错如下: configure: error: You need a C++ compiler for C++ support 那是你所用的linux没支持c++编译,只需要: apt-get install build-essential **当安装好pcre后,输入pcretest -C来打印pcre的安装情况,一般输出如下: PCRE version 8.42 2018-03-20 Compiled with 8-bit support UTF-8 support Unicode properties support No just-in-time compiler support Newline sequence is LF \R matches all Unicode newlines Internal link size = 2 POSIX malloc threshold = 10 Parentheses nest limit = 250 Default match limit = 10000000 Default recursion depth limit = 10000000 Match recursion uses stack 而如果报错为: pcretest: error while loading shared libraries: libpcre.so.1: cannot open shared object file: No such file or directory pcretest: error while loading shared libraries: libpcreposix.so.0: cannot open shared object file: No such file or directory 这种情况好像大多数linux都会发生,只需要自己建立一个软链接即可: ln -s /usr/local/lib/libpcre.so.1 /lib ln -s /usr/local/lib/libpcreposix.so.0 /lib