当前位置: 首页 > 工具软件 > Cairo > 使用案例 >

ubuntu下编译cairo库

薛晨
2023-12-01

1.编译cairo库所需的依赖包

  • zlib
  • libpng
  • pixman
  • cairo

2.编译zlib

cd zlib  #cd 到zlib包目录

./configure --prefix=/home/build_cairo_library/BuildCairo/zlib_install   #prefix指定编译后的文件存放位置

make && make install

3.编译libpng

cd libpng  #d到libpng源码目录

./configure --prefix=/home/build_cairo_library/BuildCairo/libpng_install

make && make install

4.编译pixman

cd pixman

./configure --prefix=/home/build_cairo_library/BuildCairo/pixman_install LIBS='/home/build_cairo_library/BuildCairo/zlib_install/lib/ -lz' CPPFLAGS='-I/home/build_cairo_library/BuildCairo/zlib_install/include' PNG_CFLAGS='-I/home/build_cairo_library/BuildCairo/libpng_install/include' PNG_LIBS='-L/home/build_cairo_library/BuildCairo/libpng_install/lib/ -lpng16'

make && make install

5.编译cairo

cd cairo

./configure --prefix=/home/build_cairo_library/BuildCairo/cairo_install --host=mipsel-linux --with-x  --enable-pdf --enable-ps --disable-svg --enable-png LIBS='-L/home/build_cairo_library/BuildCairo/zlib_install/lib/ -lz' CPPFLAGS='-I/home/build_cairo_library/BuildCairo/zlib_install/include/' png_CFLAGS='-I/home/build_cairo_library/BuildCairo/libpng_install/include' png_LIBS='-L/home/build_cairo_library/BuildCairo/libpng_install/lib' pixman_CFLAGS='-I/home/build_cairo_library/BuildCairo/pixman_install/include/pixman-1' pixman_LIBS='-L/home/build_cairo_library/BuildCairo/pixman_install/lib -lpixman-1'

make && make install

 

在执行./configure时遇到问题:

checking for cairo's PNG functions feature... 
configure: WARNING: Could not find libpng in the pkg-config search path
checking whether cairo's PNG functions feature could be enabled... no
configure: error: recommended PNG functions feature could not be enabled

解决方法:执行./configure之前 export png_REQUIRES="libpng16"

 类似资料: