在 Ubuntu Natty 32 位上安装 PDFLib 时出现编译错误
我正在尝试在 Ubuntu Natty (11.04) 32 位上编译 PDFLib。然而,我在“制作”阶段遇到了一些问题。
回顾一下:
- 我从 此处
- 我将内容解压缩并 cd 到目录中
- ,然后执行
./configure
,一切顺利
但是当我执行 make
时,我在运行后得到了您在下面看到的内容一会儿:
../../libtool --silent --mode=link gcc -o libpdf.la -rpath /usr/local/lib -version-info 6:5:0 ./pdflib.lo ../../libs/pdflib/libpdf_.la ../../libs/font/libfont.la ../../libs/pdcore/libpdcore.la ../../libs/png/libpng.la ../../libs/flate/libz.la ../../libs/tiff/libtiff.la ../../libs/jpeg/libjpeg.la -lm -export-dynamic
../../libtool --silent --mode=link gcc -o libs_libpdf.la ./pdflib.lo ../../libs/pdflib/libpdf_.la ../../libs/font/libfont.la ../../libs/pdcore/libpdcore.la ../../libs/png/libpng.la ../../libs/flate/libz.la ../../libs/tiff/libtiff.la ../../libs/jpeg/libjpeg.la -lm
make[2]: Leaving directory `/mnt/hgfs/src/php/pdflib-7.0.5/libs/pdflib'
make[1]: Leaving directory `/mnt/hgfs/src/php/pdflib-7.0.5/libs'
make[1]: Entering directory `/mnt/hgfs/src/php/pdflib-7.0.5/bind'
make[2]: Entering directory `/mnt/hgfs/src/php/pdflib-7.0.5/bind/pdflib'
make[3]: Entering directory `/mnt/hgfs/src/php/pdflib-7.0.5/bind/pdflib/c'
make[3]: Warning: File `../../../libs/pdflib/libs_libpdf.la' has modification time 1.2 s in the future
../../../libtool --silent --mode=compile gcc -c -I../../../libs/pdflib -I../../../libs/pdcore -O2 -g -D__NO_CTYPE -DPDC_PF_LINUX_IA32 -DASMV -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DPDF_PLATFORM=\""Linux"\" -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -Wall hello.c
../../../libtool --silent --mode=link gcc -static -o hello hello.lo ../../../libs/pdflib/libs_libpdf.la ../../../libs/pdflib/libs_libpdf.la -lm
../../../libs/pdflib/.libs/libs_libpdf.a(deflate.o): In function `deflate_slow':
/mnt/hgfs/src/php/pdflib-7.0.5/libs/flate/deflate.c:1602: undefined reference to `pdf_z_longest_match'
../../../libs/pdflib/.libs/libs_libpdf.a(deflate.o): In function `deflate_fast':
/mnt/hgfs/src/php/pdflib-7.0.5/libs/flate/deflate.c:1498: undefined reference to `pdf_z_longest_match'
../../../libs/pdflib/.libs/libs_libpdf.a(deflate.o): In function `lm_init':
/mnt/hgfs/src/php/pdflib-7.0.5/libs/flate/deflate.c:1015: undefined reference to `pdf_z_match_init'
collect2: ld returned 1 exit status
make[3]: *** [hello] Error 1
make[3]: Leaving directory `/mnt/hgfs/src/php/pdflib-7.0.5/bind/pdflib/c'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/mnt/hgfs/src/php/pdflib-7.0.5/bind/pdflib'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/mnt/hgfs/src/php/pdflib-7.0.5/bind'
make: *** [all] Error 2
我不是确定这个错误是关于什么的。我在运行 Ubuntu Natty 64 位的云服务器上运行了同样的事情,但没有遇到任何问题。
我希望得到一些指导。提前致谢。
编辑
下面是整个 shell 脚本(适用于 Ubuntu Natty 64 位)
wget http://www.pdflib.com/binaries/PDFlib/705/PDFlib-Lite-7.0.5.tar.gz
tar -zxf PDFlib-Lite-7.0.5.tar.gz
mv PDFlib-Lite-7.0.5 pdflib-7.0.5
cd pdflib-7.0.5 && ./configure && make && make install
cd ..
wget http://pecl.php.net/get/pdflib-2.1.8.tgz
tar -zxf pdflib-2.1.8.tgz
mv pdflib-2.1.8 pdflib-pecl-2.1.8
cd pdflib-pecl-2.1.8
phpize && ./configure --with-pdflib && make
cp modules/pdf.so /usr/lib/php5/20090626+lfs/
I'm trying to compile PDFLib on Ubuntu Natty (11.04) 32-bit. However, I'm running into a few issues at the 'make' stage.
Just to recap:
- I downloaded PDFLib from here
- I Extract the contents and cd into the directory
- I then do
./configure
and everything goes well
But when I do make
I get what you see below after it runs for a while:
../../libtool --silent --mode=link gcc -o libpdf.la -rpath /usr/local/lib -version-info 6:5:0 ./pdflib.lo ../../libs/pdflib/libpdf_.la ../../libs/font/libfont.la ../../libs/pdcore/libpdcore.la ../../libs/png/libpng.la ../../libs/flate/libz.la ../../libs/tiff/libtiff.la ../../libs/jpeg/libjpeg.la -lm -export-dynamic
../../libtool --silent --mode=link gcc -o libs_libpdf.la ./pdflib.lo ../../libs/pdflib/libpdf_.la ../../libs/font/libfont.la ../../libs/pdcore/libpdcore.la ../../libs/png/libpng.la ../../libs/flate/libz.la ../../libs/tiff/libtiff.la ../../libs/jpeg/libjpeg.la -lm
make[2]: Leaving directory `/mnt/hgfs/src/php/pdflib-7.0.5/libs/pdflib'
make[1]: Leaving directory `/mnt/hgfs/src/php/pdflib-7.0.5/libs'
make[1]: Entering directory `/mnt/hgfs/src/php/pdflib-7.0.5/bind'
make[2]: Entering directory `/mnt/hgfs/src/php/pdflib-7.0.5/bind/pdflib'
make[3]: Entering directory `/mnt/hgfs/src/php/pdflib-7.0.5/bind/pdflib/c'
make[3]: Warning: File `../../../libs/pdflib/libs_libpdf.la' has modification time 1.2 s in the future
../../../libtool --silent --mode=compile gcc -c -I../../../libs/pdflib -I../../../libs/pdcore -O2 -g -D__NO_CTYPE -DPDC_PF_LINUX_IA32 -DASMV -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DPDF_PLATFORM=\""Linux"\" -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\" -DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -Wall hello.c
../../../libtool --silent --mode=link gcc -static -o hello hello.lo ../../../libs/pdflib/libs_libpdf.la ../../../libs/pdflib/libs_libpdf.la -lm
../../../libs/pdflib/.libs/libs_libpdf.a(deflate.o): In function `deflate_slow':
/mnt/hgfs/src/php/pdflib-7.0.5/libs/flate/deflate.c:1602: undefined reference to `pdf_z_longest_match'
../../../libs/pdflib/.libs/libs_libpdf.a(deflate.o): In function `deflate_fast':
/mnt/hgfs/src/php/pdflib-7.0.5/libs/flate/deflate.c:1498: undefined reference to `pdf_z_longest_match'
../../../libs/pdflib/.libs/libs_libpdf.a(deflate.o): In function `lm_init':
/mnt/hgfs/src/php/pdflib-7.0.5/libs/flate/deflate.c:1015: undefined reference to `pdf_z_match_init'
collect2: ld returned 1 exit status
make[3]: *** [hello] Error 1
make[3]: Leaving directory `/mnt/hgfs/src/php/pdflib-7.0.5/bind/pdflib/c'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/mnt/hgfs/src/php/pdflib-7.0.5/bind/pdflib'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/mnt/hgfs/src/php/pdflib-7.0.5/bind'
make: *** [all] Error 2
I'm not sure what this error is about. I have run this same thing on a Cloud Server running Ubuntu Natty 64-bit and I didn't get any issues.
I'd appreciate some guidance. Thanks in advance.
EDIT
Below is the entire shell script (which worked with Ubuntu Natty 64-bit)
wget http://www.pdflib.com/binaries/PDFlib/705/PDFlib-Lite-7.0.5.tar.gz
tar -zxf PDFlib-Lite-7.0.5.tar.gz
mv PDFlib-Lite-7.0.5 pdflib-7.0.5
cd pdflib-7.0.5 && ./configure && make && make install
cd ..
wget http://pecl.php.net/get/pdflib-2.1.8.tgz
tar -zxf pdflib-2.1.8.tgz
mv pdflib-2.1.8 pdflib-pecl-2.1.8
cd pdflib-pecl-2.1.8
phpize && ./configure --with-pdflib && make
cp modules/pdf.so /usr/lib/php5/20090626+lfs/
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
建议对 PDFLib 使用 PECL 包。看看按照这些步骤安装它是否会遇到问题。
It's recommended to use the PECL package for PDFLib. See if you will have problems installing it following these steps.