title: C++ Irrlicht Program doesn't link: "undefined reference to `__imp_createDevice'"
body: <p>My Irrlicht program doesn't link. The compiler I use is g++.</p>
  
  <p>Code:</p>
  
  <pre><code>#include &lt;irrlicht.h&gt;
  
  int main()
  {
    irr::IrrlichtDevice *device = irr::createDevice();
    // And other init stuff
    while(device-&gt;run())
    {
      driver-&gt;beginScene();
      smgr-&gt;drawAll();
      guienv-&gt;drawAll();
      driver-&gt;endScene();
    }
    device-&gt;drop();
  }
  </code></pre>
  
  <p>Linker output:</p>
  
  <pre><code>...
  (path)/main.cpp:28: undefined reference to `__imp_createDevice'
  collect2.exe: error: ld returned 1 exit status
  </code></pre>
  
  <p>Command line:</p>
  
  <pre><code>g++.exe -o "(Path)\Test.exe" "(Path)\Test\main.o"
  ..\..\..\..\..\..\MinGW\lib\libIrrlicht.a
  </code></pre>
  
  <p>The linker founds the library file. What's wrong?</p>
  
  <p>Edit:
  I made little experimenting. The result was, that when I comment <code>createDevice()</code>-line out, no linker errors will come. So that means, that linker founds all the other functions, i.e. <code>IrrlichtDevice::run()</code>.</p>