Another shared library question.

Another shared library question.

Post by Rob Myer » Thu, 10 Feb 2000 04:00:00



I have a question regarding Shared Libraries:

Shared library A exports basic support functions and various public
global variables.

Shared libraries B and C use basic support code and globals by linking
to shlb A.

Application Z is linked to shlbs A, B and C . It also refers to support
code and uses globals as well as the functionality exported from B and
C.

Linking is normal CFM container linking at compile-time.

Will Z, B and C have only one copy of the globals from A, or if I call a
function in B that sets a global in A then call a function in C that
expects A's globals to be updated will things go horribly wrong?

- Rob.

 
 
 

Another shared library question.

Post by Alex Ogne » Thu, 10 Feb 2000 04:00:00


Quote:> I have a question regarding Shared Libraries:

> Shared library A exports basic support functions and various public
> global variables.

> Shared libraries B and C use basic support code and globals by linking
> to shlb A.

> Application Z is linked to shlbs A, B and C . It also refers to support
> code and uses globals as well as the functionality exported from B and
> C.

> Linking is normal CFM container linking at compile-time.

> Will Z, B and C have only one copy of the globals from A, or if I call a
> function in B that sets a global in A then call a function in C that
> expects A's globals to be updated will things go horribly wrong?

You will have the only copy of globals in A.

 
 
 

Another shared library question.

Post by meero » Thu, 10 Feb 2000 04:00:00




>> Will Z, B and C have only one copy of the globals from A, or if I call a
>> function in B that sets a global in A then call a function in C that
>> expects A's globals to be updated will things go horribly wrong?

>You will have the only copy of globals in A.

_by default_ you will have only one copy. However, it is possible to
request a separate copy of a shared lirbary's data to be instantiated by
calling GetSharedLibrary with special flags.

Hth,

meeroh

--

"Look up at the sky. Ask yourselves: Is it yes or no? Has the sheep
eaten the flower? And you will see how everything changes..."
  -- Antoine de Saint-Exupery, "The Little Prince

 
 
 

1. Shared Library Questions

I have 2 questions about shared libraries:

** How do I create empty shared library "stubs"? **
== Overview ==
I am creating an application that will be extensible via plug-in modules.
Communications with the modules will use CFM and will be a two-way street
-- I will be calling their functions and they will be calling mine.  

== The Problem ==
I need to create a "stub" shared library file to deliver to programmers
writing plug-ins, because otherwise they get link errors when calling my
functions.  I don't want to distribute the actual libraries that I'm using
because I want the links to occur at runtime, not compile-time (plus the
library object code will be pretty large).  Is there a way to do this in
Metrowerks or do I have to use an MPW tool?  

Can I build the library and then use a tool to strip the object code out
of the file?

** Will MPW mangling be compatible? **
I've heard that MPW packs structures differently than Metrowerks on the
PowerMac side.  Is this true?  Will MPW understand the name-mangling
conventions of Metrowerks, or should I declare all global routines "extern
C"?

 Thanks,
 Eric Shapiro
 Rock Ridge Enterprises

2. How does samba conform to RFC 1001/1002.

3. Shared Libraries Question ...

4. 1. EBS DBA / Hyperion Financial DBA // 2. JAVA/J2EE Developer w/ETPM exp. // 3. ETL Developer / Ab Initio Developer

5. Bloating in shared libraries question

6. IRS.Refund.

7. Shared Library question

8. FS: Brand NEW Pilot Pro's

9. Shared libraries questions

10. eyemodule, shared library call another shared library

11. Shared Library, Ansi, STL question

12. Question about C++ Exceptions within a PEF (Shared Library)

13. Question About Shared Library Entry Points