471,313 Members | 1,964 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,313 software developers and data experts.

swig-python -> shared (vs) static libraries

I am new to SWIG & Python and right now i am in the process of
wrapping some "C" functionalities present in a static library for
python. I do have my C file "name.c" which just contains some helper
I tried to link my object files (e.g name.o & name_wrap.o) with the
static libraries (whose functionalities need to be wrapped) to form a
shared library that can be imported from Python. While doing so i
cannot be able to access the C data structure from Python and i got
all values as zero. I work in Linux gcc version.
I created my shared object like this:
ld -G name.o name_wrap.o -o _name.so -Bstatic -lfoo1 -lfoo2 -lfoo3.
On the other hand to dig more in to this i tried to simulate the
static libraries with simple dummy code in my file "name.c" so that i
can avoid linking the static libraries. This case i could be able to
retrieve the vaues of the data structure. I wonder if the problem
could be due to linking of the static libraries to create the shared
Any body experienced the same problem or having related ideas pls help
Best regards

Oct 29 '07 #1
0 1975

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by Christos TZOTZIOY Georgiou | last post: by
1 post views Thread by rajesh_krec | last post: by
2 posts views Thread by Cliff Cooley | last post: by
12 posts views Thread by Bonj | last post: by
2 posts views Thread by tomdean20 | last post: by
reply views Thread by abarun22 | last post: by

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.