473,748 Members | 2,308 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

swig-python -> shared (vs) static libraries

HI
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
functions.
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
object.
Any body experienced the same problem or having related ideas pls help
me.
Best regards
Arun

Oct 29 '07 #1
0 2204

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

Similar topics

7
5693
by: Christos TZOTZIOY Georgiou | last post by:
Last night I was compiling the latest python snapshot at my home Linux system (a K6-III @420 --the extra 20 Hz is overclocking :); then I tried building a shared version of the interpreter. I did some speed comparisons, and pystone reported ~6090 pystones for the shared and ~7680 pystones for the (default) static build. This is quite a difference, and while I do know what impact position independent code has on libraries, this was the...
2
3192
by: free2cric | last post by:
Hi, I have two c++ static libraries say A.lib and B.lib. I am creating third static library C I create project in microsoft visual studio as win32 static library. I go to project-> settings -> link , i dont find object/library module where I can type in the names of A.lib and b.lib.. this option is available if i create dynamic library. Thanks cric
1
1431
by: Dani Peer | last post by:
Hi, We have few MFC 6.0 applications that are using many static libraries that are basically our infrastructure. Now we want to develop in C#, and we don't want to redesign all the infrastructure, that basically the libs are also using dependencies between them. From where to start ? and suggestions ? Thanks -- Dani
1
2541
by: rajesh_krec | last post by:
Hello Everybody, I'm using Microsoft Visual Studio .NET 2003 (with Vc7 compiler) I have some 15 projects each of which generate a static library when i build the solution in release mode. The solution also contains a project which includes all the above generated static libraries.I have set all the above projects as dependent projects in the 'Project Dependencies' option.
2
1744
by: Cliff Cooley | last post by:
Will static libraries generated by VB++ 6 always be usable by VC++ 7 applications ? Many thanks, Cliff
12
2293
by: Bonj | last post by:
can you embed a resource into a static libary? I'm using a custom binary resource specified as a .bin file in the .rc file of the static library project I've got. I use FindResource, LoadResource, LockResource to get the resource. However FindResource is returning null. If I use exactly the same code to retrieve a resource out of the resource of the console application used to test the static library, then it works perfectly. I can't see...
2
2449
by: tomdean20 | last post by:
Does anyone have a general idea of the difference in performance when compiling PHP with primarily shared extensions rather than static? A recent Yahoo presentation "PHP at Yahoo" highlighted that they built PHP with the "disable-all" option, which implies that they load all of their extensions dynamically. I'd be curious if anyone has any experience in the performance difference bewteen the two, i.e. 5% performance loss, not just "it's...
3
33108
by: salunkerahul | last post by:
Hello All, I have some static libraries generated on MSVC 2005 express edition and I have to use them along with static libraries created with MSVC 2003 and create an application on MSVC2003. example.lib - generated on MSVC2005 All other libs - generated on MSVC2003 I have attached the compiler options as well as the error log along. Any tips/suggestions will be of great help. Thanks in Advance
0
373
by: abarun22 | last post by:
HI 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 functions. 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...
0
8995
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8832
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9558
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...
0
9253
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
8250
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
6798
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
4879
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2791
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2216
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.