Code is very simple, I built it successfully. But, when running the function "GetSharedLibrary", it returns Error: "unimpErr". Why?I can't find out the reason.So, please help me, i will thank u very much.

my code is a command-line utility with C++ tools. I added the carbon framework in it.

To Fenris,
thank you very much, I see.
I tried "dlopen", but it must use the absolut path, or set the environment parameters for path. i need put the dylib files with my execution file. I can not set a dylib name in dlopen to load it??

i just know that the dylib file and the execution file will be put in the same work directory, but the path of directory can be changed. can i only set the dylib file's name in dlopen?? i think maybe it can not find the file which will be loaded if i only write the name, not path.

Is dlopen available in OS X these days? Back in the 10.2 days I used "dlcompat" to get dlopen functionality.

Anyway, CFBundle is your friend. I've implemented C++ classloading by using CFBundle to look up factory functions in my executable as well as bundled plugins and it works like a charm, on both intel and PPC. No need to set architecture flags or any other malarky. It really works, and it works really well.