1、环境变量的先后顺序,解决gs版本的问题
/usr/local/sbin
/usr/local/bin
/sbin
/bin
/usr/sbin
/usr/bin
2、gcc c++11的问题
● C89=C90:gcc选项是:-ansi, -std=c90 or -std=iso9899:1990;
○ 带了GNU扩展的:-std=gnu90
● C94=C95:gcc选项:-std=iso9899:199409
● C99:gcc选项:-std=c99 or -std=iso9899:1999
○ 未完成C99标准之前,叫做C9X
○ 带了GNU扩展的:-std=gnu99
● C11:gcc选项是-std=c11 or -std=iso9899:2011
○ 未完成C11标准之前,叫做C1X
○ 带了GNU扩展的:-std=gnu11
gcc 4.7才支持c++11
/usr/bin/gcc gcc4.4.7
/usr/local/bin/gcc gcc6.1.0
3、poppler版本问题
– checking for module ‘poppler>=0.25.0’
– package ‘poppler>=0.25.0’ not found
In order to find the pkg-config executable, it uses the PKG_CONFIG_EXECUTABLE variable or the PKG_CONFIG environment variable first.
为了找到 pkg-config 执行档,首先使用 PKG_CONFIG_EXECUTABLE 变量或者 PKG_CONFIG 环境变量。
pkg-config 简介: https://www.cnblogs.com/wliangde/p/3807532.html
pkg_check_modules
export PKG_CONFIG_PATH=/usr/lib64/pkgconfig:/usr/lib/pkgconfig:/usr/local/lib/pkgconfig
export LD_LIBRARY_PATH=/usr/lib64:/usr/lib:/lib
解决poppler的版本问题,在于pkg_config未找到相应的版本
4、cairo版本问题
– checking for module ‘cairo>=1.10.0’
– package ‘cairo>=1.10.0’ not found
默认安装cairo 的环境为usr/local 导致.pc文件在该目录下的pkgconfig中,不在pkg-config的pc文件搜索目录下
5、明明升级了gcc,为何还会报错不支持c++11
– Performing Test CXX0X_SUPPORT - Failed
CMake Error at CMakeLists.txt:100 (message):
Error: your compiler does not support C++0x/C++11, please update it.
[root@localhost build]# whereis gcc
gcc: /usr/bin/gcc /usr/lib/gcc /usr/local/bin/gcc /usr/local/lib/gcc /usr/libexec/gcc /usr/share/man/man1/gcc.1.gz
[root@localhost build]#
[root@localhost build]#
[root@localhost build]# which gcc
/usr/local/bin/gcc
为了支持编译c++11代码,将gcc升级到6.1.0版本,cmake时显示
The C compiler identification is GNU 6.1.0
The CXX compiler identification is GNU 4.4.7
导致make时c++11风格的代码编译不过,请问要如何设置?
这个问题已经解决了(没试过这个)
export CC=/usr/local/bin/gcc
export CXX=/usr/local/bin/g++
http://blog.youkuaiyun.com/u014445499/article/details/51005121
或者参考上述文档(可行):
cmake -D CMAKE_C_COMPILER=/usr/local/bin/gcc -D CMAKE_CXX_COMPILER=/usr/local/bin/g++
至此,开源库pdf2htmlEx 所有版本问题解决。cmake通过
但是make编译又出现问题了!!!
6、link cairo-poppler的错误
这是由于poppler版本依赖cairo,但是由于依赖的关系,安装poppler版本时仍使用了老的cairo库文件,因此会出现链接的错误,只要将 “cairo版本问题”解决,重新编译poppler即可。
7、链接错误 fontforge
Linking CXX executable pdf2htmlEX
/usr/lib/../lib64/libfontforge.so: undefined reference to PyTuple_SetItem'
PyObject_SelfIter’
/usr/lib/../lib64/libfontforge.so: undefined reference to
重新编译fontforge,并将/usr/lib64 中老的动态链接库替换成最新的(/usr/lib/libfontforge.so)
到此才正式编译成功!
Install the project…
– Install configuration: “Release”
– Installing: /usr/local/bin/pdf2htmlEX
– Installing: /usr/local/share/pdf2htmlEX/compatibility.js
– Installing: /usr/local/share/pdf2htmlEX/compatibility.min.js
– Installing: /usr/local/share/pdf2htmlEX/base.css
– Installing: /usr/local/share/pdf2htmlEX/base.min.css
– Installing: /usr/local/share/pdf2htmlEX/fancy.css
– Installing: /usr/local/share/pdf2htmlEX/fancy.min.css
– Installing: /usr/local/share/pdf2htmlEX/LICENSE
– Installing: /usr/local/share/pdf2htmlEX/manifest
– Installing: /usr/local/share/pdf2htmlEX/pdf2htmlEX.js
– Installing: /usr/local/share/pdf2htmlEX/pdf2htmlEX.min.js
– Installing: /usr/local/share/pdf2htmlEX/pdf2htmlEX-64x64.png
– Installing: /usr/local/share/man/man1/pdf2htmlEX.1
[root@localhost build]# pdf2htmlEX –version
pdf2htmlEX version 0.14.6
Copyright 2012-2015 Lu Wang coolwanglu@gmail.com and other contributors
Libraries:
poppler 0.35.0
libfontforge 20180227
cairo 1.12.2
Default data-dir: /usr/local/share/pdf2htmlEX
Supported image format: png jpg svg