SWIG, sample program compile errors

R

ReaprZero

Hi,

I'm using Cygwin and ActiveState perl to try to compile a sample
application using SWIG. I'm using the short tutorial from
http://www.swig.org/tutorial.html (the perl part of it), but with a
simplified version of their example (just a void hello()
{printf("Hello, world!\n");} and corresponding .i interface file,
%module hello \ extern void hello();).

I first do swig -perl5 hello.i which works fine.
Then I do:
bash-2.05b$ gcc -c hello.c hello_wrap.c -I/cygdrive/c/perl/lib/core

Which results in (because of hello_wrap.c, created by swig):
In file included from /cygdrive/c/perl/lib/core/sys/socket.h:18,
from /cygdrive/c/perl/lib/core/perl.h:722,
from hello_wrap.c:291:
/usr/include/w32api/winsock.h:81:2: warning: #warning "fd_set and
associated mac
ros have been defined in sys/types. This can cause runtime
problems with W3
2 sockets"
In file included from /cygdrive/c/perl/lib/core/sys/socket.h:20,
from /cygdrive/c/perl/lib/core/perl.h:722,
from hello_wrap.c:291:
/cygdrive/c/perl/lib/core/win32.h:74:20: direct.h: No such file or
directory
In file included from /cygdrive/c/perl/lib/core/sys/socket.h:20,
from /cygdrive/c/perl/lib/core/perl.h:722,
from hello_wrap.c:291:
/cygdrive/c/perl/lib/core/win32.h:361: warning: redefinition of
`caddr_t'
/usr/include/sys/types.h:112: warning: `caddr_t' previously declared
here
In file included from /cygdrive/c/perl/lib/core/win32.h:547,
from /cygdrive/c/perl/lib/core/sys/socket.h:20,
from /cygdrive/c/perl/lib/core/perl.h:722,
from hello_wrap.c:291:
/cygdrive/c/perl/lib/core/win32iop.h:217:1: warning: "clearerr"
redefined
In file included from /cygdrive/c/perl/lib/core/win32.h:73,
from /cygdrive/c/perl/lib/core/sys/socket.h:20,
from /cygdrive/c/perl/lib/core/perl.h:722,
from hello_wrap.c:291:
/usr/include/stdio.h:414:1: warning: this is the location of the
previous defini
tion
In file included from /cygdrive/c/perl/lib/core/perl.h:722,
from hello_wrap.c:291:
/cygdrive/c/perl/lib/core/sys/socket.h:22:1: warning: "ENOTSOCK"
redefined
In file included from /usr/include/errno.h:9,
from /cygdrive/c/perl/lib/core/perl.h:715,
from hello_wrap.c:291:
/usr/include/sys/errno.h:119:1: warning: this is the location of the
previous de
finition



I've got the latest cygwin, perl v5.6.1 built for
MSWin32-x86-multi-thread build 633 from activestate, and the latest
swigwin (swig for windows). I'm on WinXP.

Anyone have any idea what's going on? I've read lots of documentation
and searched google to no avail. Any help would be greatly
appreciated!

Thanks,
Alex Ehlke
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top