Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Assuming those methods are in one of the libs it looks like an ordering problem.</p> <p>When linking libraries into an executable they are done in the order they are declared.<br> Also the linker will only take the methods/functions required to resolve currently outstanding dependencies. If a subsequent library then uses methods/functions that were not originally required by the objects you will have missing dependencies.</p> <p>How it works:</p> <ul> <li>Take all the object files and combine them into an executable</li> <li>Resolve any dependencies among object files.</li> <li>For-each library in order: <ul> <li>Check unresolved dependencies and see if the lib resolves them.</li> <li>If so load required part into the executable.</li> </ul></li> </ul> <p>Example:</p> <p>Objects requires:</p> <ul> <li>Open</li> <li>Close </li> <li>BatchRead</li> <li>BatchWrite</li> </ul> <p>Lib 1 provides:</p> <ul> <li>Open</li> <li>Close</li> <li>read</li> <li>write</li> </ul> <p>Lib 2 provides</p> <ul> <li>BatchRead (but uses lib1:read)</li> <li>BatchWrite (but uses lib1:write)</li> </ul> <p>If linked like this:</p> <blockquote> <p>gcc -o plop plop.o -l1 -l2</p> </blockquote> <p>Then the linker will fail to resolve the read and write symbols.</p> <p>But if I link the application like this:</p> <blockquote> <p>gcc -o plop plop.o -l2 -l1</p> </blockquote> <p>Then it will link correctly. As l2 resolves the BatchRead and BatchWrite dependencies but also adds two new ones (read and write). When we link with l1 next all four dependencies are resolved.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload