title: Importing Modules in D
body: <p>I am trying to use basic module importing in D (language release 2). As a guide I used example on dlang.org but my simple program will not compile. The files are in the same directory.</p>
  
  <p>Here is my main.d file's contents:</p>
  
  <pre><code>import std.stdio;
  import mymodule;
  
  void main(string[] args){
    sayHello();
    writeln("Executing Main");
  }
  </code></pre>
  
  <p>And here is my module file's contents (mymodule.d):</p>
  
  <pre><code>void sayHello(){
    writeln("hello");
  
  }
  </code></pre>
  
  <p>To compile I execute via bash:</p>
  
  <pre><code>dmd main.d
  </code></pre>
  
  <p>And the error output is:</p>
  
  <pre><code>main.o: In function `_Dmain':
  main.d:(.text._Dmain+0x5): undefined reference to `_D8mymodule8sayHelloFZv'
  collect2: ld returned 1 exit status
  --- errorlevel 1
  </code></pre>