site_archiver@lists.apple.com Delivered-To: Darwin-dev@lists.apple.com User-agent: Mozilla Thunderbird 0.7.3 (Macintosh/20040803) Paul Forgey wrote: e.g.: shlib1 shlib2 depends on shlib1 exe depends on shlib2 How about telling you to read the manpage for ld(1)? :-p Hope this helps, Peter -- Peter O'Gorman - http://www.pogma.com _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... I'm trying to port our product to OS X/Darwin. It makes heavy use of shared libraries and it currently runs on Linux and Windows. On OS X, I'm using twolevel_namespace. As the shared libraries are built, they are output into a common directory across the source tree. This allows the ELF targets to find dependent shared libraries as needed while either another shared library or an executable is linked. On OS X, I can't figure out how to get ld to search the same directory shlib2 was in to find shlib1. With Windows this doesn't matter since the DLL worries about other dependents at load time. With Linux, ld searches the same directory. I know I could work around this by explicitly linking shlib1 to exe. However, this is very impractical because it would make the build process very clumsy. Not only would the developer have to play detective to find out what the entire dependency tree is, but the entire build tree would have to be gone through if a heavily used library changed its dependents. Don't tell me to use frameworks. This isn't a Darwin-only project. -dylib_file is the flag you need. On many platforms -L is used to search for symbols in dependent shared libraries, on darwin, the install_name that is encoded into the shared lib is the method that is used. If the dependent shared library is not yet installed then you have to use the -dylib_file flag. This email sent to site_archiver@lists.apple.com