<div class="gmail_quote">On Fri, Aug 19, 2011 at 9:38 AM, Jesse Phillips <span dir="ltr"><<a href="mailto:jessekphillips%2BD@gmail.com">jessekphillips+D@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<div class="im">maarten van damme Wrote:<br>
<br>
> the compiler flags I needed to add was -I for every src directory and -L for<br>
> the lib file. The problem with that was that those files in the src dir<br>
> don't declare the functions but also define them. They are the real source<br>
> code files so I didn't understand why the -L flag was necessary. I never<br>
> experimented further though :)<br>
<br>
</div>The process of creating an executable goes from generating machine code from source to linking the machine code for execution, as you know. The -I flag is the compiler import/include directory while -L is flags passed to the linker. That so while you may have complete source code in the import directory the compiler is only looking at the declaration and does not compile the files, it then informs the linker where the symbols can be found from the information you provide after the -L flag.<br>

</blockquote><div><br></div><div>Technically it's not saying anything about where the symbols can be found, it's just putting them into the object file as external symbols that the linker needs to resolve, but yes. The compiler basically ignores lib files and passes them to the linker.</div>

</div><br>