Can an executable be linked to a dynamic library after its built?
问题 I have built a binary 'foo'. I now want the executable to be a linked to a dynamic library 'bar'. How can I link foo to bar?(using ld or any other way). I don't want to use DYLIB_INSERT_PATH on OSX or its equivalent LD_PREOAD on Linux. I want to do this on OSX, but this question is a generic one. 回答1: What's your intention? The link process resolves symbols: it provide satisfactions to needs. If the executable doesn't need any symbols offers by the dynamic library, the linker will entirely