4

I have the following Xcode project dependencies:

A -> C
B -> C

When I build these separately, everything works fine.

However, I want to add A and B to the same Xcode project, creating the following dependency graph:

    / -> A -> C
D-<
    \ -> B -> C

This causes duplicate symbol errors, and is basically DLL hell. What is a good way to resolve this while allowing the projects to be independent? I realize that I could break up A and B's dependency on C, and then remake that dependency in D, but I want A and B to be indpendently buildable.

Heath Borders
  • 30,998
  • 16
  • 147
  • 256

1 Answers1

1

In A and B's project files, remove C from 'Link binary with libraries' while leaving it in target dependencies. This allows you to use C in A and B, but not to use C in D. To use C in D, add it directly to D (don't count on A or B passing it down).

Jacob Jennings
  • 2,796
  • 1
  • 24
  • 26