SWIG generates files that can't find off64_t in 8.10

Bug #349149 reported by jsteel
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
swig1.3 (Ubuntu)
New
Undecided
Unassigned

Bug Description

Binary package hint: swig

I found this error on 8.10 64bit, and it seems to work fine on 8.04 32bit.

Following the tutorial at http://www.swig.org/tutorial.html and trying to create a perl interface ends up producing errors. To get rid of some I had to manually point gcc at perls CORE directory. I then got the following errors:

jsteel@jsteel-desktop:~/test$ gcc -I/usr/lib/perl/5.10.0/CORE/ -lperl example_wrap.c
In file included from /usr/lib/perl/5.10.0/CORE/perl.h:4694,
                 from example_wrap.c:710:
/usr/lib/perl/5.10.0/CORE/proto.h:509: error: expected declaration specifiers or ‘...’ before ‘off64_t’
/usr/lib/perl/5.10.0/CORE/proto.h:514: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘Perl_do_sysseek’
/usr/lib/perl/5.10.0/CORE/proto.h:517: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘Perl_do_tell’
/usr/lib/perl/5.10.0/CORE/proto.h:4248: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘Perl_PerlIO_tell’
/usr/lib/perl/5.10.0/CORE/proto.h:4249: error: expected declaration specifiers or ‘...’ before ‘off64_t’

I can fix the problem by inesrting the following code at the very top of /usr/lib/perl/5.10.0/CORE/proto.h

#include <stdint.h>
typedef __off64_t off64_t;

jsteel (jon-steel)
description: updated
Revision history for this message
James Michael DuPont (jamesmikedupont) wrote :

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

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.