开发者

Getting 6 errors when compiling the wrapper module output by SWIG?

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/perl开发者_开发技巧5/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


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:

#include <stdint.h>
typedef __off64_t off64_t;

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.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜