How do I fix Perl's Font::FreeType compilation errors?

╄→尐↘猪︶ㄣ 提交于 2019-12-10 23:49:10

问题


I am trying to install the Perl module Font::FreeType on a CentOS linux box using cpan. I run sudo cpan and inside the cpan shell I run install Font::FreeType. However make fails as follows:

Writing Makefile for Font::FreeType
cp lib/Font/FreeType.pm blib/lib/Font/FreeType.pm
cp lib/Font/FreeType/Face.pm blib/lib/Font/FreeType/Face.pm
cp lib/Font/FreeType/Glyph.pm blib/lib/Font/FreeType/Glyph.pm
/usr/bin/perl /usr/lib/perl5/site_perl/5.8.8/ExtUtils/xsubpp  -typemap /usr/lib/perl5/5.8.8/ExtUtils/typemap -typemap typemap  FreeType.xs > FreeType.xsc && mv FreeType.xsc FreeType.c
gcc -c  -I/usr/include/freetype2 -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables   -DVERSION=\"0.03\" -DXS_VERSION=\"0.03\" -fPIC "-I/usr/lib/perl5/5.8.8/i386-linux-thread-multi/CORE"   FreeType.c
FreeType.c: In function ‘XS_Font__FreeType_new’:
FreeType.c:425: warning: unused variable ‘class’
FreeType.xs: In function ‘XS_Font__FreeType__Face_has_reliable_glyph_names’:
FreeType.xs:528: warning: implicit declaration of function ‘FT_Has_PS_Glyph_Names’
FreeType.xs: In function ‘XS_Font__FreeType__Glyph_char_code’:
FreeType.xs:808: error: invalid lvalue in assignment

I have googled but can't seem to find any advice on how to solve this issue. I have a feeling something may be corupted with cpane, because when I went to check my version, I was surprised:

# sudo cpan --version
/usr/bin/cpan version [unknown] calling Getopt::Std::getopts (version 1.05 [paranoid]),
running under Perl version 5.8.8.

回答1:


See http://rt.cpan.org/Public/Dist/Display.html?Name=Font-FreeType, the RT queue has patches you can apply to make the module build correctly.

Ether and Cfreak were guessing wrong, it's simply a bug due to bitrot in Font::FreeType.




回答2:


It looks like you don't have the freetype development package installed. On the command line try:

yum install freetype-devel

Let that install and then rerun the install for your perl module. (you man need to do clean Font::Freetype first)




回答3:


You can always reinstall cpan either by using itself (sudo cpan CPAN), or by manually downloading the CPAN distribution and following the build instructions.

However, generally when you get C-ish compile errors from a CPAN installation, that suggests you might be missing an underlying library. Font::FreeType uses the FreeType2 library; did you install that first? (Is it in /usr/lib/?)



来源:https://stackoverflow.com/questions/2104569/how-do-i-fix-perls-fontfreetype-compilation-errors

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!