title: I can not get an execute-on-load function to work in a library using Qt
body: <p>I have several libraries, each of which implement a class (derived from QObject). I would like each of these libraries to execute a function the first time they load. I found a couple of similar questions here:</p>
  
  <p><a href="https://stackoverflow.com/questions/9759880/automatically-executed-functions-when-loading-shared-libraries">Automatically executed functions when loading shared libraries</a></p>
  
  <p>and</p>
  
  <p><a href="https://stackoverflow.com/questions/2053029/how-exactly-does-attribute-constructor-work/2053078#2053078">How exactly does __attribute__((constructor)) work?</a></p>
  
  <p>but any initialization function I create based on the answers never executes. I've tried creating the function in a namespace, outside a namespace (and not a part of my class), using <code>__attribute__</code>((constructor)), naming it _init, and specifying the function name to the linker with:</p>
  
  <p>QMAKE_LFLAGS_RELEASE += -Wl,-init,libinitfunc</p>
  
  <p>None of these have worked.</p>
  
  <p>I should also note that I'm cross-compiling these libraries to run on an embedded ARM device that uses busybox for much of its functionality.</p>