473,856 Members | 1,637 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

SWIG, sample program compile errors

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:29 1:
/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:29 1:
/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:29 1:
/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:29 1:
/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:29 1:
/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:29 1:
/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:29 1:
/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
0 2411

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1650
by: Andrew Collier | last post by:
hello, i am not sure whether this problem relates to swig, python or my c++ compiler. +please forgive me if this is inappropriately posted but i am sure that someone +on this list must have some good ideas. i have also sent i to the swig users list a couple of times but have not got any response so i am casting my net a little wider... i have been struggling with the following problem for a couple of days now. +specifically, i have a...
2
1915
by: superprad | last post by:
Hi I am trying to write a python wrapper for a C code I have using swig. when i try to compile the _wrap.c i get a bunch of these warnings and errors can anyone help Steps I followed : $swig -python test_hk.c this generates test_hk.py and test_hk_wrap.c then i compile it as $gcc -Wall -std=c99 test_hk.c test_hk_wrap.c -I/usr/include/python2.3/
1
2621
by: superprad | last post by:
Hi I am trying to write a python wrapper for a C code I have using swig. when i try to compile the wrap.c i get a bunch of these warnings and errors can anyone help $swig -python test_hk.c this generates test_hk.py and test_hk_wrap.c then i compile it as $gcc -Wall -std=c99 test_hk.c test_hk_wrap.c -I/usr/include/python2.3/
2
4461
by: ajikoe | last post by:
Hi, I tried to follow the example in swig homepage. I found error which I don't understand. I use bcc32, I already include directory where my python.h exist in bcc32.cfg. /* File : example.c */ #include <time.h>
0
1143
by: stumblecrab | last post by:
Hello, I've looked at the swig example in the back of "programming python" (Lutz). Using gcc to compile a swig wrapper I'm getting lots of errors. Instead of using the cygwin python, I'm trying to point swig to my activepython installation. I'm doing this because my modules are all win32 installed, and not cygwin installed. Can anyone help me? I'm pointing to C:/python24/include and C:/python24/Libs.
3
2910
by: sapsi | last post by:
Hello, I'm not sure if this the correct list but here goes (and sorry for the noise). I've been attempting to wrap python around libhdfs. So far so good (i've attached the SWIG template at the end). The compilation works without errors and the shared objects do have references to all the functions. However, when importing into python import pyhdfs
3
3703
by: Soren | last post by:
Hi, I went through the SWIG tutorial for the example named "simple". I managed to get to the first step, creating example_wrap.c using swig, and doing: "gcc -fpic -c example_wrap.c -IC:\python24\include " to create example_wrap.o But when I needed to compile the library file using:
0
1057
by: RLC | last post by:
Hello I am new to python SWIG. Recently I wrote a small program trying to import collada files(using colladadom) into python so I could use python cgkit to render them. However, during the progressing, I got some problems. Every time I quit from Python, I get a segmentation fault, although the main program runs well. I suspect it is because I wrapped std::vector objects in C struct and I did not release the memory properly. Below is the...
0
11063
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10790
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10390
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9535
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7932
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7098
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5762
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5960
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4580
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.