undefined reference to `function'
<p>For some reason the program is giving me this error </p>

<p><code>undefined reference to createNetworkDriver</code></p>

<p>Right now my folder structure is:</p>

<pre><code>mini-kernel/
            kernel/
                   drivers/
                           network/
                                   network.h
                                   network.c
           util/
                errors/
                       errors.c
           main.c
</code></pre>

<p>network.h:</p>

<pre><code>#ifndef _network_h_
#define _network_h_
#pragma once

#include &lt;stdbool.h&gt;
#include&lt;stdint.h&gt;

typedef struct
{
    char *name;
    bool initalized;
    int32_t status;
    int (*initalize)(void);
}NetworkDriver;

NetworkDriver* createNetworkDriver(void);
NetworkDriver* destroyNetworkDriver(NetworkDriver *self);
#endif
</code></pre>

<p>network.c:</p>

<pre><code>#include "network.h"
#include "../../../util/errors/errors.c"

extern void die(const char *message);

NetworkDriver* createNetworkDriver(void)
{
    printf("Working");
    NetworkDriver nd = malloc(sizeof(NetworkDriver));
}

NetworkDriver* destroyNetworkDriver(NetworkDriver *self)
{
    if(self-&gt;initalized == true)
        free(self);
    else
        die("NET_DRIVER FAILED TO DESTROY");

}
</code></pre>

<p>errors.c:</p>

<pre><code>#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;
#include &lt;errno.h&gt;

void die(const char *message)
{
    if(errno) {
        perror(message);
    } else {
        printf("ERROR: %s\n", message);
    }

    exit(1);
}
</code></pre>

<p>And finally my main.c:</p>

<pre><code>#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;
#include &lt;errno.h&gt;
#include "kernel/drivers/network/network.h"


int main(int argc, char *argv[])
{
    NetworkDriver *nd = createNetworkDriver();
}
</code></pre>

<p>And for some reason when i run the <code>main.c</code> file <code>gcc main.c -std=c99 -w -lm</code> , i get the error: <code>undefined reference to createNetworkDriver</code>.</p>

<p>Im currently programming this online <a href="https://ide.c9.io/amanuel2/mini-kernel" rel="nofollow">here</a>.</p>