469,645 Members | 1,634 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,645 developers. It's quick & easy.

Swig compile errors

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/

/usr/lib/gcc-lib/i486-linux/3.3.5/../../../crt1.o(.text+0x18): In
function `_start':
.../sysdeps/i386/elf/start.S:98: undefined reference to `main'
/tmp/ccayOWVb.o(.text+0xb6f): In function `PySwigObject_repr':
: undefined reference to `PyString_FromFormat'
/tmp/ccayOWVb.o(.text+0xbe1): In function `PySwigObject_str':
: undefined reference to `PyString_FromString'
/tmp/ccayOWVb.o(.text+0xc22): In function `PySwigObject_long':
: undefined reference to `PyLong_FromUnsignedLong'
/tmp/ccayOWVb.o(.text+0xc87): In function `PySwigObject_oct':
: undefined reference to `PyOS_snprintf'
and a bunch of them..............

: undefined reference to `PyModule_GetDict'
collect2: ld returned 1 exit status

do I have to include any libraries or whats it that I am missing.

Jul 19 '05 #1
2 1766
su*******@gmail.com wrote:
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/


Worth a try:

gcc -Wall -std=c99 -I/usr/include/python2.3/ test_hk.c test_hk_wrap.c
Jul 19 '05 #2
Nop No luck. That dint work.

Jul 19 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Andrew Collier | last post: by
reply views Thread by ReaprZero | last post: by
reply views Thread by Jerry He | last post: by
1 post views Thread by superprad | last post: by
2 posts views Thread by ajikoe | last post: by
reply views Thread by stumblecrab | last post: by
3 posts views Thread by sapsi | last post: by
3 posts views Thread by Soren | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.