Solved

Shared Library Implementation Question

Posted on 2000-05-05
3
240 Views
Last Modified: 2013-12-26
I am creating a PPC shared library using CW Pro 5 and am somehwat confused by apparently conflicting information I have been reading. Can I place the shared library in the extensions folder and have my application access it or must I include the shared library file in my application project for it to be available? Also, do I have to create a special .h file to define access to the routines or are they resolved for me automatically?
0
Comment
Question by:creality
3 Comments
 
LVL 1

Expert Comment

by:charlass
ID: 2785366
Hi,
I'm not really a Mac expert but noone was answering so far...

Need other applications this SHL?
If not than it is the easiest way to put it into your app dir. An other way could be to place the SHL somewhere, create a link and move this link-file into your app dir.

You need a .h file for all the other cpp-files who want to call a SHL function (this for the compiler)
And you have to declare which functions you want to export from your SHL. There are three ways to do this, check the linker settings.
I prefer the "#pragma export" method.
Your .h file:

----------
extern int not_exported_func();

#pragma export on
extern int exported_func();
#pragma export off
----------

Ask next week for details 'cause I am sitting now at a Windows PC.
bye!

0
 
LVL 1

Accepted Solution

by:
twall earned 50 total points
ID: 2794240
Shared libraries on the mac are loaded in a predefined search order, explained in the Inside Mac documentation (see the documentation for shared libraries on developer.apple.com).

I believe the application's folder precedes the system extensions folder in the search list.

0
 

Author Comment

by:creality
ID: 2794425
Thanks. That should be enought to get me started. Thanks a lot.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Turn a spreadsheet into a vba executable. 2 96
has77  challenge 9 92
FizzBuzz challenge 9 82
Bartender label printing - switch on and off graphics 3 56
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question