<div class="gmail_quote">On Thu, Apr 16, 2009 at 7:25 PM, Bill Hoffman <span dir="ltr">&lt;<a href="mailto:bill.hoffman@kitware.com">bill.hoffman@kitware.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">Robert Dailey wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
What do you mean &quot;specified order&quot;? Why does the order of static libraries matter? And also what do you mean by &quot;repeats&quot;? <br>
</blockquote></div>
Linkers on unix (including apple) require that the order of static libraries be specified in order of symbol usage.   Sometimes this requires a library to be repeated more than once on the link line, like -lA -lB -lA.  If A and B are Xcode static libraries, and you have executable C that uses them, there is no way in Xcode other than raw linker commands to get it to use -lA -lB -lA.  So, CMake uses -lA -lB -lA all the time.  The problem comes in because you can not put external depends on a C in Xcode.  So, we use a helper makefile to remove C if A or B changes.   It is really horrible, but at least Xcode provided a way to get around the problem using makefiles....</blockquote>
<div><br></div><div>Thanks for explaining Bill. What you&#39;ve just explained is very confusing to me. What I&#39;m trying to do is investigate CMake a bit more so we can get it working for the iPhone. However, what you&#39;ve just brought up I still have a few more questions about but to ask them would be getting a bit off-topic from CMake itself. I need to figure out why the linker would require library A to be linked in twice, and perhaps the best way to do this is to look at an existing project that actually specifies a library to be linked multiple times.</div>
<div><br></div><div>As a final request (again, to avoid going off-topic), I would really appreciate it if you could reference me to any reading materials on this subject. Perhaps if Xcode does not allow a single library to be added multiple times means that not every library must be linked against more than one time regardless of the result of flattening the dependency tree?</div>
<div><br></div><div>Again, thanks for the help Bill. I&#39;ve been primarily stuck on Windows as a developer and I&#39;m not familiar with such a linker requirement.</div></div>