gcc -fpic -c gd_wrap.c -Dbool=char -I/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE
:
In file included from /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE/op.h:499,
from /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE/perl.h:2754,
from gd_wrap.c:731:
/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE/reentr.h:612: error: field ‘_crypt_struct’ has incomplete type
In file included from /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE/perl.h:3950,
from gd_wrap.c:731:
/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE/proto.h:297: error: expected declaration specifiers or ‘...’ before ‘off64_t’
/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE/proto.h:299: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘Perl_do_sysseek’
/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE/proto.h:300: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘Perl_do_tell’
/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE/proto.h:2009: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before Perl_PerlIO_tell’
/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE/proto.h:2010: error: expected declaration specifiers or ‘...’ before ‘off64_t’
有人熟悉这个错误吗?
我使用的是 Centos 5.5
,perl 版本是 5.8.8
最佳答案
这是一个众所周知的错误(只需在 google 上搜索关键字 Perl_do_sysseek 和 swig 即可。
我过去发现了两种解决方案。
第一个确实很脏(我鄙视它),但可以 100% 工作。它包括在“proto.h”文件的顶部添加以下几行:
#include <stdint.h>
typedef __off64_t off64_t;
第二个系统比第一个系统更干净。您应该将 swig 升级到版本 2.0 并重试。如果不起作用,您可以尝试将 perl 升级到版本 5.10.0。
关于c - 编译 SWIG 的包装器模块输出时出现 6 个错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6493322/