Why is the linker complaining about missing symbols in my library?

Hi all.


I'm building a static library (for Google protocol buffers) and then an application that uses it. The library appears to build fine.


But attempts to link against it result in loads of "Undefined symbols for architecture x86_64". I examined the lib with nm and the symbols all appear to be in there, so what gives?


The lib and app are built in sequence with Clang and the same compiler options (I'm doing it in Qt, and there doesn't even appear to be a way to set different ones for sub-projects in the IDE).


Not sure what other info to provide, but if anyone has some likely culprits I'd like to hear them.


Thanks!

Replies

I'd say show at least the link command and its output and the output of "nm -m yourlib" (at least the part about the relevant symbols).