Centos 7 cef_binary_3.2785.1440.g1ee311f_linux64编译之路

cef这个库 一般来说都是运行在windows下的 ,下面是我在linux编译的过程


链接是我的网盘链接地址 大家可以去下载cef


http://pan.baidu.com/s/1eSboi10

密码55qx


1.首先 安装cmake工具

cmake
出现错误 版本太低 更新cmake版本

    
    
./configure makemake install
如果上面安装出现了错误
运行下列命令
yum install gcc
yum install gcc-c++ 安装编译器

该版本默认配置到/usr/local/bin 下
cmake工具安装完成

2.cmake编译cef包

cmake CMakeList.txt
所以后面可能出现错误
-bash: /usr/bin/cmake: No such file or directory
后面知道这个问题是因为直接使用cmake系统回到默认的/usr/bin中去寻找,但是src中安装的cmake是在/usr/local/bin中
解决方法:
1、做一个链接即可:ln -s /usr/local/bin/cmake /usr/bin
2、直接使用/usr/local/bin/cmake进行编译。
这样这个问题就解决了
3.编译出现的第二个错误 首先需要安装gtk包
yum install gtk3* 这样安装的包都是gtk-3.0版本的相关依赖

安装完成后需要继续编译
   
   
In file included from /homewangwecodecef_binary_3.2785.1440.g1ee311f_linux64cefclientbrowserclient_handlerh:160, from browser_window11cc5:client_types1221:致命错误:gtk:没有那个文件或目录 #include <gtk/gtk.h>

出现了这个错误 证明你需要修改cmake文件了
打开 CMakeList.txt文件在注释的下面加上以下部分
  
  
# Include the libcef_dll_wrapper target.# Comes from the libcef_dll/CMakeLists.txt file in the binary distribution# directory.add_subdirectory(${CEF_LIBCEF_DLL_WRAPPER_PATH} libcef_dll_wrapper)add_definitions(`pkg-config --libs cflags gtk+-3.0`)(-I usrinclude/gtk-3.0/unix-print-3)
这样编译后错误就会消失 继续make 你会发现下一个错误
[ 91%] Building CXX object cefclient/CMakeFilesdircefclient_gtko623gtkgl<gtk/gtkgl.h>
这是因为gtk的opengl库没有安装 需要下个包继续安装输入以下命令
用git版本下载到本地
git clone git://git.gnome.org/gtkglext
下载完后 继续编译
  • root@localhost gtkglext]# lsAUTHORS gdk MAINTAINERSautogensh gdkglextpcin makecopyrightshChangeLogpre-10 gdkglextuninstalledin MakefileamChangeLog2 gtk NEWSconfigureac gtkglextdoap READMECOPYING gtkglextnsiin READMEwin32COPYINGLIB gtkglextin setupgtkglextshdocs gtkglextin TODOexamples m4macrossh which no gtkdocize in (/localbin:/sbin/.)*** No GTK-Doc found please install it ***
    运行autogen文件出现以下错误 需要安装gtk-doc
    yum install gtkdoc

    这样会将所有的依赖都安装上
    继续运行 出现以下错误
    I am going to run configure with no arguments if you wish to pass any to it please specify them on the sh command lineautoreconf Entering directory `.' configureac not using Gettext running aclocal force I m4macros $ACLOCAL_FLAGS tracing libtoolize copy forcelibtoolize putting auxiliary files in ' copying file `./ltmainsh putting macros in AC_CONFIG_MACRO_DIR`m4macrosm4macroslibtoolm4ltoptionsltsugarltversionlt~obsoleteautoconf autoheader automake addmissing forcemissing62 installing './config.guess''./config.sub'55'./install-sh''./missing'Makefileam'./INSTALL'examples/Makefile'./depcomp'gdk212 error HAVE_INTROSPECTION does not appear in AM_CONDITIONAL113 automake failed with exit status
    这个错误找了好久 发现到了需要安装gobject-introspection这个包

    3.安装gobject-introspection

    //git.gnome.org/gobject-introspection
    参考这个包的官网
    https://wiki.gnome.org/action/show/Projects/GObjectIntrospection?action=show&redirect=GObjectIntrospection
    下载好了 就安装 这个仍然是运行
    root@localhost gobjectintrospectionI m4 $ creating directory buildaux putting auxiliary files in AC_CONFIG_AUX_DIRbuildauxauxm443'build-aux/compile'30'build-aux/config.guess''build-aux/config.sub'20'build-aux/install-sh''build-aux/missing'Makefile'build-aux/depcomp''build-aux/ylwrap'Makefilegiscanner28'build-aux/py-compile'Makefile22'Makefile-giscanner.am' included from hereparalleltests'build-aux/test-driver' Leavingchecking for a BSDcompatible install...install cchecking whether build environment is sane yes a threadsafe mkdir pmkdir p gawk gawkchecking whether make sets $MAKE)...checking whether make supports nested variableschecking whether UID '0' is supported by ustar formatchecking whether GID checking how to create a ustar tar archive gnutarchecking whether to enable maintainerspecific portions of Makefilescachedchecking build system type x86_64unknownlinuxgnuchecking host system type gcc gccchecking whether the C compiler works C compiler default output file name aout suffix of executables checking whether we are cross compiling no suffix of object files ochecking whether we are the GNU C compilerchecking whether gcc accepts g gcc option to accept ISO C89 none needed style of include used by make GNUchecking dependency style of gcc gcc3checking whether gcc and cc understand c and o togetherchecking how to print strings printf a sed that does not truncate outputsed grep that handles long lines and egrep egrepgrep E fgrepF ld used by gccld the linker ld is GNU ld BSD or MScompatible name lister nmnm Bchecking the name lister B interface BSD nmchecking whether ln s workschecking the maximum length of command line arguments1572864checking whether the shell understands some XSI constructschecking whether the shell understands "+="checking how to convert x86_64gnu file names to x86_64gnu format func_convert_file_noopgnu file names to toolchain formatld option to reload object filesr objdump objdumpchecking how to recognize dependent libraries pass_all dlltoolchecking how to associate runtime and link libraries printf %s\n ar ar archiver @FILE support@ strip strip ranlib ranlibchecking command to parse B output from gcc object ok sysroot mt is a manifest toolchecking how to run the C preprocessor gcc ANSI C header files systypesstat stdlib string memory strings inttypes stdint unistd dlfcn objdirlibs gcc supports fnortti exceptions gcc option to produce PICfPIC DPIC gcc PIC flag DPIC works gcc static flag - worksc o filechecking whether the gcc linker ld m elf_x86_64 supports shared librarieschecking whether lc should be explicitly linked inchecking dynamic linker characteristics GNU/Linux ldsochecking how to hardcode library paths into programs immediatechecking whether stripping libraries is possible libtool supports shared librarieschecking whether to build shared librarieschecking whether to build libraries pkgconfigconfigchecking pkgconfig is at least version 0.90... flex flexchecking lex output file root lexyychecking lex librarychecking whether yytext is a pointer bison bison y dlopen in ldl the suffix of shared libraries GLIB Package requirements glib2.0>=2.494 were not met:Requested'glib-2.0 >= 2.49.4' but version of GLib is 2.422Consider adjusting the PKG_CONFIG_PATH environment variable youinstalled software in a nonstandard prefix.Alternatively you may set the environment variables GLIB_CFLAGSand GLIB_LIBS to avoid the need to call pkg.See the pkgconfig man page more details.
    出现错误glib版本太陈旧 安装新glib
    root@localhost glib.6configure
    
         
         
  • libffi 3.0:No package 'libffi' foundConsider the environment variables LIBFFI_CFLAGSand LIBFFI_LIBS to avoid the need to call pkg
  • glib依赖libffi 仍需要安装
    make install
    编译成功 可以重新编译glib了
    configurechecking whether gcc understands checking minixh usabilityh presence minixchecking whether it is safe to define __EXTENSIONS__ Win32 the Android Mac OS X Carbon OS X Cocoachecking whether to enable garbage collector friendlinesschecking whether to disable memory pools c++...++ the GNU C compilerchecking whether c accepts checking dependency style of c special C compiler options needed large files _FILE_OFFSET_BITS value needed 0.16 perl5 perl perl indent indentperl a Python interpreter with version 2.5 python pythonpython python version2.7 python platform linux2 python script directory $prefix}/libpython27sitepackages python extension module directoryexec_prefixlib64 iconv_open ZLIB LIBFFI.
    仍然提示这个错误 这是因为 环境变量的问题 加上以下一句话
    export PKG_CONFIG_PATH=/pkgconfig
    重新配置 出现下列依赖包
    libpcre 8.13'libpcre' found

    这个可以直接用yum安装了
    yum install pcre-devel yum install pcre
    将所有依赖都安装上
    这次可以编译glib库了
    make install
    一路顺风直接安装上

    4.继续编译gobject-introspection

    headers required to compile python extensions line 14668python such file or directorynot found Python headers not found
    出现以上错误 初步断定是python的依赖包没有安装
    安装python依赖包
    yum install python*
    其实安装个别的包就可以了 由于我不知道哪一个 都安装了
    安装完成可以编译gobject-introspection文件了
    仍是三步
    make install


    之后编译gtkgtext出现如下错误
  • 按照如下方法解决
    mkdir root cd ..root@localhost codeg1ee311f_linux64 glib6 libffi3.21cmake2.812.1 gobjectintrospection12.1targz gtkglext cd gobject/ cp m4 vi ../gtkglext/configure.ac
    116 AC_CHECK_PROG([ms_librarian],76)">exeyesno])117118 AC_PROG_LN_S119120 AC_PATH_PROGSPERLperl5 perl121122 AC_CONFIG_MACRO_DIR([/123124##################################################125# GObject introspection126127128 GOBJECT_INTROSPECTION_CHECK([1.40129130131# Checks for gtk-doc and docbook-tools132##################################################

    添加122行 为m4路径
    打开 [ root@localhost gobject - introspection ]# vi ../gtkglext/Makefile.am
    在第6行 10行分别添加一下两句话
    ACLOCAL_AMFLAGS =m4 $7 DISTCHECK_CONFIGURE_FLAGS enabledoc 89 EXTRA_DIST \10 root/m4m4 \11 READMEwin32 \12 ChangeLog1314in \15 gtkglext16171819nsi \20 setup2122## Copy .pc files to target-specific names23 GDK_TARGET @gdktarget@

    按照如上方法就可以完成了
    这样在执行
    sh
    就可以配置成功了
    接下来make编译 出现错误缺少opengl的库文件
    、查看mesa相关的包yum list mesa*2、安装这些包yum install mesa*安装完成后,我们就拥有了一个基础的OpenGL开发环境了,但是仅仅有基础的开发环境是不够的,一般来讲,我们还要安装一个叫做Glut的库,这是一个OpenGL的辅助库,可以让我们创建与平台无关的OpenGL窗口。因此,安装Glut也是必要的。 Glut有很多种实现,在这里我用的是freeglut3glut*glut、安装freeglut freeglut到这里,我们就完成了OpenGL的安装了。

    以上完成之后 opengl安装完成 但是编译过程中仍然会出现问题
    在最后执行文件的时候出现问题 使用
    设置环境变量 export LD_LIBRARY_PATH=/usr/lib:/usr/local/lib

    因为系统安装的软件默认在/usr/lib下 我们指定的安装路径在/usr/local/lib下
    注:以上安装的我们软件在配置的时候 ./configure --prefix=/usr/local 最好要加上这个参数 这样 我们在最后编译过程中才会轻松

    系统安装的方式不同可能出现的问题也不同 以上是我编译过程中出现的问题

    版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

    相关推荐


    #使用军哥的lnmp配置虚拟主机,需要注意的是要配置hosts文件(这一点官方没有讲到)具体方法:1、修改hosts文件sudo vim /etc/hosts2、在hosts文件中新增一行(这里类似于windows上配置hosts文件)127.0.0.1 www.baidu.com3、保存并重启网络
    一、配置编译环境 yum update &amp;&amp; yum upgrade yum groupinstall &quot;Development Tools&quot; yum install gcc gcc-c++ pcre* openssl* gd-devel* zlib-devel
    一、下载repo文件 二、备份并替换系统的repo文件 三、执行yum源更新操作
    LAMP -- Linux Apache MySQL PHP 在CentOS安装的顺序,我一般是Apache&#160;-&gt;&#160;MySQL&#160;-&gt;&#160;PHP 第一步、安装并配置Apache 1、使用yum安装 [plain]&#160;view plaincopy
    一、下载nginx安装包,官网下载中心http://nginx.org/download [root@localhost software]# wget http://nginx.org/download/nginx-1.10.1.tar.gz 二、解压nginx安装包 [root@localhos
    1.下载composer curl -sS https://getcomposer.org/installer | php ps:如果出现php无法运行的情况,请先把PHP加入环境变量,具体操作参考《centOS安装PHP》 2.移动或复制composer到环境下可执行 cp composer.ph
    一、卸载旧版本的vim 二、安装终端字符处理库ncurses 三、下载Vim8 四、编译安装 五、添加到系统环境变量 六、安装成功
    引言 我们在日常的开发过程中,很多时候需要连接服务器查看日志或者在服务器上调试代码。但是,使用 ssh 命令登录服务器每次都需要输出密码,就比较繁琐。因此我们可以使用 sshpass 通过参数指定密码进行登录。解决了这个问题之后,我发现登录服务器之后,还需要手动 cd 切换到项目目录或者日志目录。为
    iptables basics Introduction iptables 是一个配置 Linux 防火墙的工具,是 netfilter 项目的一部分。 在 Linux Kernel 3.13 及以上版本中, nftables 将作为后继者取代 iptables 以成为更强大易用的防火墙工具 Bas
    一、下载tengine 二、安装tenginx(nginx)的模块依赖库 三、解压并指定安装路径 四、编译安装 五、启动(tengine)nginx 六、访问(tengine)nginx
    这篇文章介绍了如何快速部署一套Kubernetes集群,下面就快速开始吧! 准备工作 机器部署规划 主机 | IP | 部署组件 | | master主节点 | 192.168.199.206 | etcd、kube apiserver、kube controller manager、kube sc
    一、pip下载 二、解压安装 三、安装完成
    1、WebBench安装: yum install ctags(先安装依赖库) mkdir /usr/local/man (创建一个目录不然会报错) wget http://home.tiscali.cz/~cz210552/distfiles/webbench-1.5.tar.gz tar zxv
    1:查看环境: [root@10-4-14-168 html]# cat /etc/redhat-release CentOS release 6.5 (Final) 2:关掉防火墙 [root@10-4-14-168 html]# chkconfig iptables off 3:配置CentOS
    安装 1.检查当前是否有安装php rpm&#160;-qa|grep&#160;php 如果有安装PHP,那么请先删除这些安装包: yum&#160;remove&#160;php* 2.安装php源 Centos 5 安装php源: rpm&#160;-ivh&#160;http://mirro
    一、安装 二、配置 三、修改配置文件 四、program 配置 五、启动
    Sed 日常使用介绍 简介 是 环境下常用的流处理工具, 可以处理字符流, 文件或者二进制文件流。 各个 发行版都会配备 及其衍生的命令工具, 因此, 掌握该工具的基本用法, 足以满足我们日常的许多文本处理的任务。 以下采用示例的方式对 进行基本用法介绍. 如果有兴趣了解更高级的使用技巧, 本文采用
    linux下开机自启: 在/etc/init.d目录下新建文件elasticsearch 并敲入shell脚本: 注意, 前两行必须填写,且要注释掉。 第一行为shell前行代码,目的告诉系统使用shell。 第二行分别代表运行级别、启动优先权、关闭优先权,且后面添加开机服务会用到。 shell脚本
    1、因为在centos7中/etc/rc.d/rc.local的权限被降低了,所以需要赋予其可执行权 chmod +x /etc/rc.d/rc.local 2、赋予脚本可执行权限假设/usr/local/script/autostart.sh是你的脚本路径,给予执行权限 chmod +x /usr
    最简单的查看方法可以使用ls -ll、ls-lh命令进行查看,当使用ls -ll,会显示成字节大小,而ls- lh会以KB、MB等为单位进行显示,这样比较直观一些。 通过命令du -h –max-depth=1 *,可以查看当前目录下各文件、文件夹的大小,这个比较实用。 查询当前目录总大小可以使用d