Poppler Cross-compiling

Source: Internet
Author: User
Tags cairo

The project needs to generate and open the PDF file, compile the Pdflib library, can be used, but there are watermarks ... You need permission to use the watermark for commercial purposes. No way, change.

Then there is Poppler, the library is very powerful, it is added to the QT support, just right for the project needs.


But... But add up to compile Poppler more than half a month has failed, the internet has not found a solution, I am really drunk, this poppler support QT should be the best choice, no way, continue to compile at intervals. The following is the compilation of their own problems encountered in the record, hope later people less detours.


1. Support for library compilationPoppler compilation requires a lot of libraries, and after Configuer will tell you which libraries are already available and which ones are not. There is not a record here, the compilation of those libraries online a lot. In fact, you compile the process of error, you first see what is wrong, if it is missing a header file or the like, most of it needs to be the library you did not compile. My compilation has failed, began to think that the library support is not enough, it shows the library all cross-compiled, and finally has been reported libpoppler-glib.so wrong format.Many of the online explanations for this problem are 32-bit and 64-bit files that cause the file format to be incorrect, but how can I use a 32-bit system to compile the problem with the wrong format?Later inadvertently in http://www.linuxfromscratch.org/blfs/view/svn/general/poppler.html see Poppler compile need to bring library, according to what it said required

Fontconfig-2.11.1

Recommended

Cairo-1.14.2, libjpeg-turbo-1.4.1, libpng-1.6.17, and OpenJPEG-1.5.2

Just need to fontconfig library on it, the other library is only recommended, then I will be the original Cairo and glib library are removed, the final Configuer configuration as follows
Pkg_config_path=/opt/poppler/lib/pkgconfig fontconfig_cflags= "-i/opt/poppler/include/fontconfig/" FONTCONFIG_ libs= "-l/opt/poppler/lib-lfontconfig"  freetype_cflags= "-i/opt/poppler/include/freetype2/" FREETYPE_LIBS= "-l /opt/poppler/lib-lfreetype "libtiff_cflags="-i/opt/poppler/include "libtiff_libs="-l/opt/poppler/lib-ltiff " libopenjpeg_cflags= "-i/opt/poppler/include/openjpeg-1.5" libopenjpeg_libs= "-l/opt/poppler/lib-lopenjpeg" LIBJPEG _cflags= "-i/opt/poppler/include" libjpeg_libs= "-l/opt/poppler/lib-ljpeg" CC=ARM-LINUX-GCC CPPFLAGS= "-I/opt/ Poppler/include "cflags="-i/opt/poppler/include "ldflags="-l/opt/poppler/lib-lz-ljpeg "./configure--host= Arm-linux--prefix=/opt/poppler  --enable-libjpeg  --enable-libpng <span style= "color: #ff0000;" >--disable-cairo-output</span>


2. QT Library errorAfter removing Cairo, there is no problem of glib library, but the problem of Qt library appears./usr/include/qt4/qtcore/qatomic_i386.h:132:error:impossible constraint in ' asm '
The question on the Internet most of the answer is that there are multiple qmake, that is, qmake the road is not right, so I added in the Configuer of Qt and the road strength and library
pkg_config_path=/opt/poppler/lib/pkgconfig fontconfig_cflags= "-I/opt/ poppler/include/fontconfig/"fontconfig_libs="-l/opt/poppler/lib-lfontconfig "freetype_cflags="-I/opt/poppler/ include/freetype2/"freetype_libs="-l/opt/poppler/lib-lfreetype "libtiff_cflags="-I/opt/poppler/include "LIBTIFF_ libs= "-l/opt/poppler/lib-ltiff" libopenjpeg_cflags= "-i/opt/poppler/include/openjpeg-1.5" LIBOPENJPEG_LIBS= "-L/ Opt/poppler/lib-lopenjpeg "libjpeg_cflags="-i/opt/poppler/include "libjpeg_libs="-l/opt/poppler/lib-ljpeg "CC= ARM-LINUX-GCC cppflags= "-i/opt/poppler/include" cflags= "-i/opt/poppler/include" ldflags= "-l/opt/poppler/lib-lz- Ljpeg "<span style=" color: #ff0000; " >poppler_qt4_cflags= "-i/opt/qt-4.8.5-embedded/include" poppler_qt4_libs= "-l/opt/qt-4.8.5-embedded/lib-lqtgui -lqtcore-lqtxml-lqtscript-lqtnetwork "</span>/configure--host=arm-linux--prefix=/opt/poppler-- Enable-libjpeg--enable-libpng--disable-cairo-output 

I tried to get rid of QT4 support, and the compilation was successful. That's a good news. If you do not need QT support you should already be able to use the 3, Tslib library problem
/opt/qt-4.8.5-embedded/lib/libqtgui.so:undefined reference to ' Ts_read_raw '/opt/qt-4.8.5-embedded/lib/libqtgui.so : Undefined reference to ' Ts_open '/opt/qt-4.8.5-embedded/lib/libqtgui.so:undefined reference to ' TS_FD '/opt/ qt-4.8.5-embedded/lib/libqtgui.so:undefined reference to ' Ts_config '/opt/qt-4.8.5-embedded/lib/libqtgui.so: Undefined reference to ' ts_close '/opt/qt-4.8.5-embedded/lib/libqtgui.so:undefined reference to ' Ts_read '
Many people say that this problem is because the arm-linux-g++/qmake.conf file was not modified, that is not joined# Modifications to G++.conf
QMAKE_CC = Arm-linux-gcc-lts
Qmake_cxx = arm-linux-g++-lts
Qmake_link = arm-linux-g++-lts
Qmake_link_shlib = arm-linux-g++-ltsBut this is because you in the cross-compiling QT source is not joined the Tslib library support, and I compile the QT library has joined the Tslib support, so the qmake.conf file has been supported by TS, but there is no Tslib function error found. Follow the on-line recommendations to add in qmake.confQmake_lflags + =-wl,-rpath-link=/opt/tslib-1.4/libre-compiling the Qtgui library, the problem is still there. found that the error is the QT4 directory of the demo and tests folder compilation, decisively in Makefile removed the compilation of these two folders. Finally, libpoppler.so, libpoppler-cpp.so and libpoppler-qt4.so were successfully generated. OK next is to follow the example of the official website to try the library can be used. give a link to the official website: http://people.freedesktop.org/~aacid/docs/qt4/    

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Poppler Cross-compiling

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.