title: How to create and load a GTK module?
body: <p>I want to create a custom GTK module which should be loaded when I start a GTK application.</p>
  
  <p>Documentation on this topic is rare, I searched a lot but I failed to get it running. I'm on Ubuntu Linux with GTK3 and tried sofar:</p>
  
  <ul>
  <li>Compiled and linked a shared library with the method <code>void gtk_module_init(gint *argc, gchar ***argv[])</code> inside. As far as I understood, this should be enough to create a simple module. Full code:</li>
  </ul>
  
  <pre class="lang-c prettyprint-override"><code>#include &lt;iostream&gt;
  #include &lt;gtk/gtk.h&gt;
  
  void gtk_module_init(gint *argc, gchar ***argv[]) {
      std::cout &lt;&lt; "huhu" &lt;&lt; std::endl;
  }
  </code></pre>
  
  <ul>
  <li>Put this lib into /usr/lib/x86_64-linux-gnu/gtk-3.0/modules/libtest-gtk-module.so</li>
  <li>Tried to launch an application like this: <code>gnomine --gtk-module=libtest-gtk-module.so</code> But all I get is: <code>Gtk-Message: Failed to load module "libtest-gtk-module.so"</code></li>
  </ul>
  
  <p><strong>So what else has to be done in order to make GTK load this library?</strong></p>
  
  <p>Many thanks in advance!</p>