在OSX上。用make构建。
我的设置:
./configure --enable-static=yes --enable-shared=no
我从vanilla FreeType 2.5.3下载中没有改变任何其他内容。
这导致libfreetype.a并且当添加到项目(链接二进制文件库)时,我得到了各种构建错误,我没有用阴影库获得:
"_BZ2_bzDecompress", referenced from:
_ft_bzip2_file_fill_output in libfreetype.a(ftbzip2.o)
"_png_create_info_struct", referenced from:
_Load_SBit_Png in libfreetype.a(sfnt.o)
"_inflateInit2_", referenced from:
_FT_Stream_OpenGzip in libfreetype.a(ftgzip.o)
等等。
所以如果我用这个构建它会更奇怪./configure:
./configure --enable-static=yes --enable-shared=no --with-png=no --with-bzip2=no --with-zlib=no
然后我可以构建我的项目,但是当我运行它时,我得到一个错误,说找不到/opt/local/lib/libfreetype.6.dylib。当然不是,因为它只是使用共享的FreeType构建。
如何构建一个完全无依赖的FreeType(就像网站上说的那样)?
非常感谢, 伊恩
答案 0 :(得分:5)
我最终成功 - 通过调整this answer并为blib
添加排除项。png
,bzip
忽略iOS片段......
./configure CFLAGS="-arch i386" --without-zlib --without-png --without-bzip2
make clean
make
cp objs/.libs/libfreetype.a libfreetype-i386.a
./configure CFLAGS="-arch x86_64" --without-zlib --without-png --without-bzip2
make clean
make
cp objs/.libs/libfreetype.a libfreetype-x86_64.a
lipo -create -output libfreetype.a libfreetype-i386.a libfreetype-x86_64.a
对我来说,使用FreeType 2.5.5 + Yosemite + Xcode 6.2
混合使用