项目需要生成和打开pdf文件,编译了pdflib库,可以使用,但是上面有水印。。。如果是商业用途去水印的话需要获得许可。没办法,换呗。
然后就是poppler,这个库的功能很强大,里面更是加入了Qt的支持,刚好适合项目需求。
但是。。。但是前前后后加起来编译poppler半个多月一直失败,网上也没找到解决办法,我真是醉了,这个poppler支持Qt应该是最好的选择方式了,没办法,隔一段时间继续编译。以下是自己编译过程中遇到的问题记录下来,望后来的人少走弯路。
Fontconfig-2.11.1
Cairo-1.14.2, libjpeg-turbo-1.4.1, libpng-1.6.17, and OpenJPEG-1.5.2
只需要Fontconfig库就可以了,其他的库只是推荐的,然后我就将原本的Cairo和glib库都去掉了,最后的configuer配置如下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 --disable-cairo-output
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" POPPLER_QT4_CFLAGS="-I/opt/qt-4.8.5-embedded/include" POPPLER_QT4_LIBS="-L/opt/qt-4.8.5-embedded/lib -lQtGui -lQtCore" ./configure --host=arm-linux --prefix=/opt/poppler --enable-libjpeg --enable-libpng --disable-cairo-output
/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'
很多人都说这个问题是因为没有修改arm-linux-g++/qmake.conf文件,即没有加入