473,804 Members | 2,962 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

What is "shared library" in C, is there any small example I can see?

Confusing th eword with "library", "shared library" and how to use
these things in real C project, is there any small example I can take a
look. Thanks.

Nov 15 '05 #1
2 2042
In article <11************ **********@o13g 2000cwo.googleg roups.com>,
<sa***********@ yahoo.com> wrote:
Confusing th eword with "library", "shared library" and how to use
these things in real C project, is there any small example I can take a
look. Thanks.


The C language itself does not have "library" or "shared library"
or "project". The C standard requires that the implementation provide
a standard set of routines which it calls "the standard library",
but the C standard puts no restriction on how the implementation
does that.

It is -common- for implementations to provide ways of bundling
groups of half-compiled programs, and that those bundles can
be referenced by the linking phase in order to provide access
to the routines and data, but there is a fair variability in
how that is done.

A "shared library" (in common parlance) is just another
library (with system-dependant semantics and invocation
mechanisms). Again the C standard has nothing to say on
the matter.

When a system bothers to distinguish between a "library"
and a "shared library", it might commonly be saying that
only one copy of the "shared library" will be placed in memory
for access by all users and all processes, whereas a library
on such a system that was -not- "shared" would have a copy of
some or all of it placed into each process's address space.

Details of what a "library" or "shared libary" mean on your
system, and how to use them, should be asked about in a newsgroup
appropriate for your system. As I mentioned before, they are not
C concepts as such, and there are important differences between
different systems.
--
Chocolate is "more than a food but less than a drug" -- RJ Huxtable
Nov 15 '05 #2

<sa***********@ yahoo.com> wrote
Confusing th eword with "library", "shared library" and how to use
these things in real C project, is there any small example I can take a
look. Thanks.

Most C implentations allow you to build "libraries" - compiled function
which can be called from user code. The standard library and extensions will
probably come with the compiler as "library" files.

On a big system, exactly what some of these libraries do can be complex. For
instance a sophisticated operating system won't want printf() writing pixels
directly to the screen, it will want facilities for capturing and
redirecting output, changing fonts, providing braile access for blind users,
and so. Also it doesn't make any sense to load a huge system for one "hello
world" program - better have all the code resident in memory.

Exactly what "shared library" menas can differ, however, as Walter pointed
out. It could mean a libary which more than one application links to, it
could mean a library of which only one copy is in memory at any one time, it
could mean a library like the braile printf example which several programs
access simulataneously in a cooperative manner.
Nov 15 '05 #3

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

Similar topics

10
3090
by: Berthold Hoellmann | last post by:
Hello, When I use ./configure --with-thread --with-fpectl --with-signal-module \ --with-pymalloc --enable-shared --with-cxx=g++ make test on 2.3.3 I get
5
5678
by: apple | last post by:
UDBV8 fp 6a - AIX 5.1 We have scheduled cron jobs to do backups. Periodically and starting to occur more frequently, a backup fails with this error: SQL2072N Unable to bind the shared library "". Reason code: "". We are backing up to a file system on the server. Can't find anything in the logs. We can manually resubmit the job 15 or 30 minutes later and everything works fine. Any ideas on what might be happening? The documentation on...
2
1635
by: Jenna Schmidt | last post by:
I know that one of the benefits of using "Shared" methods is you do not explicitly have to Dim as New object to access the method. Are there some other implications with memory and concurrency issues with lets say 25-50 concurrent users? What are the pros and cons of using this type of method? Thanks so much,
1
6785
by: David Sanschagrin | last post by:
(I previously posted this problem on vb.general.discussion but I've been told that this question is more related to VB.NET than VB6 and so that I should post that here.) I'm trying to call a "Public Shared" function in a dll built in VB.NET from a VB6 program. Whenever I try, I get an error saying that the function doesnt exist. I had doubts that the "Shared" in the VB.NET dll could be the problem. I tried to
7
7358
by: Carsten H. Pedersen | last post by:
Hello I want to create a kind of shared object. I have created a class, Counter, which you can then import. Through the Counter class, i would like to have access to a shared object. Lets say that Counter contains only an int, initialised to 1. Each time a class importing Counter would do Counter.getNextNumber(), the getNextNumber() method would increase the local int, and return the next number.
2
1561
by: HmFireBall | last post by:
Hi, This is a question about a shared property in ASP.NET Imagine there's an assembly called my.dll that is in the /bin directory of several websites. This assembly contains a class with a shared property called MySharedProp. Its value is initialized inside the shared constructor of the class and should be based on values declared in the web.config of
3
19320
by: Kenneth Kahl | last post by:
Hello, I would like to call a C++ programm out of Java with help of JNI. By the followed command I created a "shared library": g++ -shared -o libcalculate.so rechner.cpp When I create an object from the existing program inside a method of my class rechner.cpp, and then call the method out of java, a following
3
2272
by: jbeteta | last post by:
Hello, I have a problem declaring variables. I need to create an object oRpte as ReportClass on WebForm1.aspx and be able to use its value on WebForm2.aspx. For declaring the property oRpte() on WebForm1.aspx, I use "Public Property" and I declare variable _oRpte as Friend Shared. That's my problem. If I don't declare _oRpte as Friend Shared, I can't use WebForm1.oRpte() on other webpage. If I declare _oRpte as Friend Shared, I can use...
3
2334
by: amit2781 | last post by:
I am trying to build the my project on HPUX (HP-UX oscar B.11.11 U 9000/800 741028561 unlimited-user license) which access the Mysql library. But it is giving error as : Error : MySQL51/lib/hpux/libmysqld.a(client.o) - shared library must be position independent. Use +z or +Z to recompile. I am using this option in building: aCC -Wl,+s,-E,+vnocompatwarnings -z -g0 -b -Wl,-Bsymbolic. I also tried using the +Z, +z, also added...
0
9704
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
10561
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
10318
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10069
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...
1
7608
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
5505
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
5639
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3803
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2976
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.