undefined reference to 'funtion_name'
<p>im having trouble understanding how to get the code in my src folder as shown below to run the header file in the include folder.</p>

<p><a href="https://i.stack.imgur.com/FNE3t.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FNE3t.png" alt="enter image description here"></a></p>

<p>Include contains a <code>functions.h</code> file, and src contains a <code>functions.c</code> file as well as my <code>main.c</code></p>

<p>The main contains a <code>#include "functions.h"</code>, and a reference to a function declared in <code>function.h</code> and <code>function.c</code></p>

<p>When i'm in the main directory, to compile everything, I run the following:</p>

<pre><code>gcc -Wall -Werror -Iinclude src/main.c
</code></pre>

<p>But I get this back in the terminal:</p>

<pre><code>/tmp/ccHmaM4g.o: In function `main':
main.c:(.text+0x78): undefined reference to `sum'
collect2: error: ld returned 1 exit status
</code></pre>

<p>I am fairly new to linux, please tell me what I'm doing wrong.
Cheers!</p>