编译 SWIG 的包装器模块输出时出现 6 个错误?
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
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’
Anyone familiar with this error?
I'm on Centos 5.5
and perl version is 5.8.8
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是一个众所周知的错误(只需在 google 上搜索关键字 Perl_do_sysseek 和 swig。
我过去发现了两个解决方案。
第一个确实很脏(我鄙视它),但可以 100% 工作。它包括添加 at “proto.h”文件的顶部有以下几行:
第二个系统比第一个系统更干净 您应该将 swig 升级到版本 2.0 并重试,如果它不起作用,您可以尝试升级。 perl 到版本 5.10.0。
It is a well known bug (simply search on google for keywords Perl_do_sysseek and swig.
There are two solutions I have found in the past.
The first is really dirty (and I despise it) but works at 100%. It consist in adding at the top of "proto.h" file these lines:
The second system it's cleaner then the first. You should upgrade swig to version 2.0 and retry. If it doesn't work you can try upgrading perl to version 5.10.0.
这是我的 makefile,它为我解决了问题。
全部 : 测试
-isystem /usr/local/include
CFLAGS= -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing -pipe -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
icinga-core-wrap-perl.c : icinga-core.i
swig -perl -outcurrentdir -o icinga-core-wrap-perl.c -oh icinga-core-wrap-perl.h icinga-core.i
icinga-core-wrap-perl.o :icinga-core-wrap-perl。 c
gcc $(CFLAGS) -I../include icinga-core-wrap-perl.c -I/usr/lib/perl/5.10.1/CORE/ -o icinga-core-wrap-perl.o
测试 : icinga-核心包裹perl.o
echo todo
https://gitorious.org/icinga/icinga-core/commit/5c19af4baf01b6741bdef782a33339da0e403de6
This is my makefile that solves the problem for me.
all : test
-isystem /usr/local/include
CFLAGS= -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fno-strict-aliasing -pipe -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
icinga-core-wrap-perl.c : icinga-core.i
swig -perl -outcurrentdir -o icinga-core-wrap-perl.c -oh icinga-core-wrap-perl.h icinga-core.i
icinga-core-wrap-perl.o : icinga-core-wrap-perl.c
gcc $(CFLAGS) -I../include icinga-core-wrap-perl.c -I/usr/lib/perl/5.10.1/CORE/ -o icinga-core-wrap-perl.o
test : icinga-core-wrap-perl.o
echo todo
https://gitorious.org/icinga/icinga-core/commit/5c19af4baf01b6741bdef782a33339da0e403de6