By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,491 Members | 1,212 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,491 IT Pros & Developers. It's quick & easy.

SWIG, sample program compile errors

P: n/a
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
Jul 19 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.