title: Undefined reference to .. error (Linux) - Compiles fine in OSX
body: <p>Have wasted almost full 4 days trying to compile this package. It compiles fine in OSX 10.6, but gives Undefined reference errors when I try to compile it on a linux (Kubuntu 10.04, 3.8.0.27 kernel) machine.</p>
  
  <p>The error seem to be that the makefiles are ordered wrong, but AFAIK, I am the only one having trouble compiling it. So I'm trying to find what's making the difference. The software package is quite big and editing the Makefiles and moving 30-50 libraries here and there doesn't seem like a good idea.</p>
  
  <p>Here's the differences I think I found so far</p>
  
  <ul>
  <li>Compiler - <strong>gcc-4.7</strong> (Linux) and <strong>llvm-gcc-4.2</strong> (OSX)</li>
  <li>Compiler flags <strong>--shared</strong> (Linux) and <strong>-dynamic -dynamiclib -undefined dynamic_lookup</strong> (OSX)</li>
  </ul>
  
  <p>Anyone have any suggestions?</p>
  
  <ol>
  <li><p>I tried using <code>clang++</code> and <code>llvm-gcc-4.7</code> as the compiler, but I think it still used the same linker (<code>ld</code>?). So I could try to specify to use <code>llvm</code>? How do I do that?</p></li>
  <li><p>is <code>--shared</code> flag somehow different from the <code>dynamic -dynamiclib -undefined dynamic_lookup</code> flags in OSX?</p></li>
  <li><p>Does the linux kernel or distribution matter? (I think they compiled it fine on a CentOS machine)</p></li>
  </ol>
  
  <p>Please help.
  Thanks a lot.</p>