Shared Library Implementation Question

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?
Who is Participating?
twallConnect With a Mentor Commented:
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

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

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.

crealityAuthor Commented:
Thanks. That should be enought to get me started. Thanks a lot.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.