I currently have a binary file (test) which links against another dynamic library (ie. liba.dylib) which links against another library (ie. libb.dylib). This is all set up in my XCode project and liba.dylib (which has a linker flag set -lb to link against libb.dylib) and libb.dylib will build just fine on their own. But when I try to build the binary which links against liba.dylib, it will complain that "warning can't open dynamic library: libb.dylib referenced from: /path/to/liba.dylib (checking for undefined symbols may be affected) (No such file or directory, errno = 2)"
Why does it say that there is no such file when they actually exist in the same directory? Why is libb not able to resolve the liba symbols?
You likely need to include all linked libraries as part of the reference at compilation.
Not sure whether you can rely on the compiler to scan through every linked library referenced to make sure that the linked libraries each references is present.
i.e. library a referenced library c which in turn references library d.
you may need to use the -c flag when compiling/linking to skip the check for subsequent symbols/dynamic libraris not directly referenced.
Hmm, I will give the -c flag a try when linking. If that doesn't work then you are probably right about having to list all the dependencies. I will get back to you when I find out. Thanks.